13 void addGui(
int connectionId);
16 void send(
int connectionId,
const std::string& msg);
20 const std::string& teamName)
override;
25 void onBroadcast(
int playerId,
const std::string& message)
override;
30 void onEggLaid(
int eggId,
int playerId,
int x,
int y)
override;
35 const std::vector<int>& participantIds)
override;
38 void onGameEnd(
const std::string& winningTeam)
override;
ResourceType
Enumerate the different types of resources in the game.
Owns every client socket and runs the poll() loop.
void addGui(int connectionId)
void onIncantationStart(int x, int y, int level, const std::vector< int > &participantIds) override
Incantation began on a tile. participantIds = players involved. -> pic.
void onInitialEggSpawned(int eggId, const std::string &teamName, int x, int y) override
An initial team egg placed at game start (custom). -> sse.
void onPlayerAdded(int playerId, int x, int y, Orientation orientation, int level, const std::string &teamName) override
Player spawned (egg hatched or initial connection). -> pnw.
void broadcast(const std::string &msg)
std::vector< int > _guiIds
void onEggLaid(int eggId, int playerId, int x, int y) override
A player laid an egg via Fork. -> enw.
void onEggHatched(int eggId) override
An egg hatched into a connectable slot. -> ebo.
void onGameEnd(const std::string &winningTeam) override
A team won (6 players at max level). -> seg.
void onPlayerEjected(int playerId) override
Player got pushed off its tile by an eject. -> pex.
void onPlayerMoved(int playerId, int nx, int ny, Orientation newOrientation) override
Player changed tile and/or facing. -> ppo.
void onPlayerRemoved(int playerId) override
Player left (death or disconnect). -> pdi.
void onResourceTaken(int playerId, ResourceType resourceType, int tileX, int tileY, Resources resources) override
Player picked a resource up off the tile. -> pgt (+ bct/pin)
void onBroadcast(int playerId, const std::string &message) override
Player shouted a broadcast message. -> pbc.
void onResourceDropped(int playerId, ResourceType resourceType, int tileX, int tileY, Resources resources) override
Player dropped a resource onto the tile. -> pdr (+ bct/pin)
void onEggDied(int eggId) override
An egg was destroyed (e.g. crushed by an eject). -> edi.
void onPlayerLevelUp(int playerId, int newLevel) override
Player reached a new level. -> plv.
void onPlayerInventoryChanged(int playerId, int x, int y, Resources inventory) override
Player's carried resources changed. -> pin.
void onTileChanged(int x, int y, Resources resources) override
A tile's resource contents changed (e.g. respawn). -> bct.
void onIncantationEnd(int x, int y, bool success) override
Incantation finished, success = leveled up or not. -> pie.
void send(int connectionId, const std::string &msg)
void removeGui(int connectionId)
Observer hooks for game-state changes (Observer pattern).
Represents the resources available in the game, including food and various minerals.