StaticInitializerOrder.cpp 720 B

123456789101112131415161718192021222324252627282930
  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. #include "ItemEntity.h"
  18. // world updates
  19. #include "AddChunkUpdate.h"
  20. #include "PlaceBlockUpdate.h"
  21. #include "BlockChangedUpdate.h"
  22. #include "BlockRemovedUpdate.h"
  23. #include "AddEntityUpdate.h"
  24. #include "EntityChangedUpdate.h"
  25. #include "EntityRemovedUpdate.h"