6#ifndef BOMBERMAN_SIM_SPAWNSLOTS_H
7#define BOMBERMAN_SIM_SPAWNSLOTS_H
17 constexpr uint8_t kLeftSpawnCol = 1;
18 constexpr uint8_t kRightSpawnCol =
static_cast<uint8_t
>(
tileArrayWidth - 2);
19 constexpr uint8_t kTopSpawnRow = 1;
20 constexpr uint8_t kBottomSpawnRow = 9;
37 {kLeftSpawnCol, kTopSpawnRow},
38 {kLeftSpawnCol, kBottomSpawnRow},
39 {kRightSpawnCol, kTopSpawnRow},
40 {kRightSpawnCol, kBottomSpawnRow},
43 static_assert(baseTiles[kTopSpawnRow][kLeftSpawnCol] == Tile::EmptyGrass,
"Top-left spawn must stay clear");
44 static_assert(baseTiles[kBottomSpawnRow][kLeftSpawnCol] == Tile::EmptyGrass,
"Bottom-left spawn must stay clear");
45 static_assert(baseTiles[kTopSpawnRow][kRightSpawnCol] == Tile::EmptyGrass,
"Top-right spawn must stay clear");
46 static_assert(baseTiles[kBottomSpawnRow][kRightSpawnCol] == Tile::EmptyGrass,
"Bottom-right spawn must stay clear");
60 static_cast<int32_t
>(slot.col) * 256 + 128,
61 static_cast<int32_t
>(slot.row) * 256 + 128
constexpr unsigned int tileArrayWidth
Tile map width in tiles.
Definition Const.h:43
Shared authoritative movement simulation primitives.
Shared simulation primitives and constants used by both the client and the authoritative server.
Definition Movement.h:21
constexpr std::array< SpawnSlotCell, 4 > kDefaultSpawnSlots
Default player-id keyed spawn slots for the current arena layout.
Definition SpawnSlots.h:36
constexpr TilePos spawnSlotTilePos(const SpawnSlotCell slot)
Converts one tile-cell spawn slot to a center-position tile-Q8 coordinate.
Definition SpawnSlots.h:57
constexpr SpawnSlotCell spawnSlotCellForPlayerId(const uint8_t playerId)
Returns the default spawn slot assigned to the given player id.
Definition SpawnSlots.h:50
constexpr TilePos spawnTilePosForPlayerId(const uint8_t playerId)
Returns the default center-position tile-Q8 spawn for the given player id.
Definition SpawnSlots.h:67
One multiplayer spawn slot expressed in tile-cell coordinates.
Definition SpawnSlots.h:24
Tile-space Q8 position representing the CENTER of the entity.
Definition Movement.h:30