StaticInitializerOrder.cpp 599 B

1234567891011121314151617181920212223242526
  1. #define _REGISTRY
  2. #include "Registries.h"
  3. int count_ItemType = 0;
  4. int count_BlockType = 0;
  5. int count_WorldUpdateType = 0;
  6. int count_EntityType = 0;
  7. #undef REGISTER
  8. #define REGISTER(c, typ) \
  9. const int c::ID = count_##typ++; \
  10. const c *c::INSTANCE = new c();
  11. // order of includes determines the ids
  12. // block types
  13. #include "NoBlock.h" // must be first
  14. #include "BasicBlocks.h"
  15. // entities
  16. //#include "Player.h"
  17. // world updates
  18. #include "AddChunkUpdate.h"
  19. #include "PlaceBlockUpdate.h"
  20. #include "BlockChangedUpdate.h"
  21. #include "BlockRemovedUpdate.h"