A 2D tile-based sandbox game.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Mod.h 683B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <stdint.h>
  3. #include <string>
  4. #include <vector>
  5. #include <memory>
  6. #include "Tile.h"
  7. #include "WorldGen.h"
  8. #include "Entity.h"
  9. namespace Swan {
  10. class Mod {
  11. public:
  12. using ModID = uint32_t;
  13. std::string name_;
  14. std::string path_;
  15. std::vector<std::shared_ptr<Tile>> tiles_;
  16. std::vector<std::shared_ptr<WorldGen::Factory>> worldgens_;
  17. std::vector<std::shared_ptr<Entity::Factory>> entities_;
  18. bool inited_ = false;
  19. void init(const std::string &name);
  20. void registerTile(const std::string &name, Tile *tile);
  21. void registerWorldGen(const std::string &name, WorldGen::Factory *gen);
  22. void registerEntity(const std::string &name, Entity::Factory *ent);
  23. };
  24. }