begin client-server

This commit is contained in:
2025-08-06 20:10:56 +02:00
parent 89213e9a97
commit c813c49707
26 changed files with 264 additions and 188 deletions

View File

@@ -1,25 +1,25 @@
#pragma once
#include <td/simulation/WorldTicker.h>
#include <td/game/WorldTypes.h>
#include <td/protocol/packet/Packets.h>
#include <td/simulation/WorldTicker.h>
namespace td {
namespace game {
class World {
protected:
// header
TowerTileColorPalette m_TowerPlacePalette;
Color m_WalkablePalette;
std::vector<Color> m_DecorationPalette;
Color m_Background;
ChunkList m_Chunks;
SpawnColorPalette m_SpawnColorPalette;
TilePalette m_TilePalette;
//data
ChunkList m_Chunks;
std::shared_ptr<sim::WorldSnapshot> m_CurrentState;
std::shared_ptr<sim::WorldSnapshot> m_NextState;
@@ -28,6 +28,7 @@ class World {
public:
World();
World(World&&) = default;
bool LoadMap(const protocol::pdata::WorldHeader& worldHeader);
bool LoadMap(const protocol::pdata::WorldData& worldData);
@@ -130,8 +131,9 @@ class World {
private:
void TickMobs(std::uint64_t delta);
void CleanDeadMobs();
};
using WorldPtr = std::shared_ptr<World>;
} // namespace game
} // namespace td