commit 497a601c424e8e728ef0a8e61f049982f2d4af16 Author: Persson-dev <sim16.prib@gmail.com> Date: Sat Aug 12 10:32:52 2023 +0200 fix warning commit 1bfd019a1ea00dcdb6323d1f285e2cdd3ebb4020 Author: Persson-dev <sim16.prib@gmail.com> Date: Tue Jul 25 19:05:13 2023 +0200 refactor: update cast commit 5bbc23a7d37e53eb74a885685f18e714f9448fd9 Author: Persson-dev <sim16.prib@gmail.com> Date: Tue Jul 25 19:04:15 2023 +0200 moved GetImguiTeamColor commit fd0e2d2470ea5cca3553acf280aa371de5c06f4c Author: Persson-dev <sim16.prib@gmail.com> Date: Tue Jul 25 19:03:37 2023 +0200 packets forward declaration commit 06eb9b99a96731f4b9a2167c00ed0bcd03702e3b Author: Persson-dev <sim16.prib@gmail.com> Date: Tue Jul 25 18:30:55 2023 +0200 remove Protocol.h includes commit 165f63d2e8b468f3e38992baddc221270010f801 Author: Persson-dev <sim16.prib@gmail.com> Date: Tue Jul 25 18:30:30 2023 +0200 split packets into separate source files commit f247f146c6c1e804a44b86f65cf3059859c07c6c Author: Persson-dev <sim16.prib@gmail.com> Date: Tue Jul 25 17:45:24 2023 +0200 split packets into separate headers
61 lines
1.9 KiB
C++
61 lines
1.9 KiB
C++
#pragma once
|
|
|
|
#include "protocol/Protocol.h"
|
|
#include "game/BaseGame.h"
|
|
|
|
namespace td {
|
|
namespace protocol {
|
|
|
|
struct WorldHeader {
|
|
game::TowerTileColorPalette m_TowerPlacePalette;
|
|
Color m_WalkablePalette;
|
|
std::vector<Color> m_DecorationPalette;
|
|
Color m_Background;
|
|
|
|
game::SpawnColorPalette m_SpawnColorPalette;
|
|
|
|
game::TilePalette m_TilePalette;
|
|
|
|
game::Spawn m_RedSpawn, m_BlueSpawn;
|
|
game::TeamCastle m_RedCastle, m_BlueCastle;
|
|
|
|
const game::World* m_World;
|
|
};
|
|
|
|
class WorldBeginDataPacket : public Packet {
|
|
private:
|
|
WorldHeader m_Header;
|
|
public:
|
|
WorldBeginDataPacket() {}
|
|
WorldBeginDataPacket(const game::World* world) {
|
|
m_Header.m_World = world;
|
|
}
|
|
virtual ~WorldBeginDataPacket() {}
|
|
|
|
virtual DataBuffer Serialize(bool packetID = true) const;
|
|
virtual void Deserialize(DataBuffer& data);
|
|
virtual void Dispatch(PacketHandler* handler) const;
|
|
|
|
virtual PacketType GetType() const { return PacketType::WorldBeginData; }
|
|
|
|
const game::TowerTileColorPalette& GetTowerTilePalette() const { return m_Header.m_TowerPlacePalette; }
|
|
const Color& GetWalkableTileColor() const { return m_Header.m_WalkablePalette; }
|
|
const std::vector<Color>& GetDecorationPalette() const { return m_Header.m_DecorationPalette; }
|
|
const Color& GetBackgroundColor() const { return m_Header.m_Background; }
|
|
|
|
const game::Spawn& GetRedSpawn() const { return m_Header.m_RedSpawn; }
|
|
const game::Spawn& GetBlueSpawn() const { return m_Header.m_BlueSpawn; }
|
|
|
|
const game::SpawnColorPalette& GetSpawnPalette() const { return m_Header.m_SpawnColorPalette; }
|
|
|
|
const game::TeamCastle& GetRedCastle() const { return m_Header.m_RedCastle; }
|
|
const game::TeamCastle& GetBlueCastle() const { return m_Header.m_BlueCastle; }
|
|
|
|
const game::TilePalette GetTilePalette() const { return m_Header.m_TilePalette; }
|
|
|
|
void setWorldHeader(const WorldHeader& header) { m_Header = header; }
|
|
};
|
|
|
|
} // namespace protocol
|
|
} // namespace td
|