2,734
edits
m (Use Nasal highlighter) |
Red Leader (talk | contribs) m (Remove line numebrs) |
||
| Line 250: | Line 250: | ||
Using this technique, you can reduce the complexity of huge conditional blocks. For example, consider this extract from weather_tile_management.nas: | Using this technique, you can reduce the complexity of huge conditional blocks. For example, consider this extract from weather_tile_management.nas: | ||
<syntaxhighlight lang="nasal | <syntaxhighlight lang="nasal"> | ||
if (code == "altocumulus_sky"){weather_tiles.set_altocumulus_tile();} | if (code == "altocumulus_sky"){weather_tiles.set_altocumulus_tile();} | ||
else if (code == "broken_layers") {weather_tiles.set_broken_layers_tile();} | else if (code == "broken_layers") {weather_tiles.set_broken_layers_tile();} | ||