Core
Classes | |
| class | Archive |
| Simple system for accessing archive content. More... | |
| class | ArchiveDirectory |
| class | ArchiveFile |
| class | ArchiveGenerator |
| Utility class used to pack files together into an Archive file. More... | |
| class | ArchiveManager |
| class | Asset |
| class | AssetEnumerator |
| class | CommandLine |
| class | DebugFont |
| Debug font rendering. More... | |
| class | Filename |
| class | FrameTime |
| class | GameState |
| class | GameStateManager |
| class | Random |
| class | Singleton< TYPE > |
| class | StringId |
| Lightweight type for storing strings for use as ID's. More... | |
| class | StringIdTable |
Files | |
| file | Debug.h |
| Useful debug functions. | |
| file | StandardLibrary.h |
| Standard library functionality. | |
Defines | |
| #define | strSwitch(stringId) StringId _multiple_strSwitch_not_allowed_within_one_code_block_=stringId; |
| Macro to emulate the behavior of the switch-statement for StringIds. | |
| #define | strCase(stringId) |
| Macro to emulate the behavior of the case-statement for StringIds. | |
Define Documentation
| #define strSwitch | ( | stringId | ) | StringId _multiple_strSwitch_not_allowed_within_one_code_block_=stringId; |
Macro to emulate the behavior of the switch-statement for StringIds.
Macro to emulate the behavior of the switch-statement for StringIds Used in conjunction with the strCase macro.
Example use:
strSwitch (myFruitTypeStringId) { strCase(Apples) { // code to do stuff here }
strCase(Oranges) { // code to do other stuff here } }
The above is the equivalent of doing:
static StringId applesId("Apples"); if (myFruitTypeStringId==applesId) { // code to do stuff here }
static StringId orangesId("Oranges"); if (myFruitTypeStringId==orangesId) { // code to do other stuff here }
Note that you can't have to strSwitch blocks within the same code block, and you can't test for the same strCase more than once in the same strSwitch. The internal variable names of the macros have been chosen to indicate these errors in case it is attempted accidentally.
Definition at line 168 of file StringId.h.
| #define strCase | ( | stringId | ) |
Value:
static StringId _duplicate_strCase_statement_##stringId(#stringId); \ if (_duplicate_strCase_statement_##stringId==_multiple_strSwitch_not_allowed_within_one_code_block_) \
Macro to emulate the behavior of the case-statement for StringIds Used in conjunction with the strSwitch macro (see strSwitch for further info)
Definition at line 178 of file StringId.h.
Reproduction/republishing of any material on this site without permission is strictly prohibited.
