+Entity *World::AddPlayer(const std::string &name) {
+ for (Entity *e : players) {
+ if (e->Name() == name) {
+ return nullptr;
+ }
+ }
+ Entity &player = AddEntity();
+ player.Name(name);
+ // TODO: load from save file here
+ player.Bounds({ { -0.5f, -0.5f, -0.5f }, { 0.5f, 0.5f, 0.5f } });
+ player.WorldCollidable(true);
+ player.Position(config.spawn);
+ players.push_back(&player);
+ chunks.QueueSurrounding(player.ChunkCoords());
+ return &player;