5#include "CoreMinimal.h"
15 Grid(
const Dim& dim,
const IPositionRandomizerPtr& randomizer = MakeShared<PositionRandomizer>());
36 void update(
const TPositionPtr* links, CellType cellType);
43 void update(
const Position& position, CellType cellType);
51 bool hitTest(
const Position& position, CellType cellType)
const;
58 UE_NODISCARD
bool randomEmptyPosition(
Position& position)
const;
64 TArray<CellType> m_cells;
65 TMap<CellType, TArray<uint32>> m_indByType = {
66 {CellType::Snake, {}},
71 TSharedPtr<IPositionRandomizer> m_positionRandomizer;
74 void updateInternal(
const Position& position, CellType cellType);
75 void freeCellsByType(CellType cellType);
77 FORCEINLINE uint32 posToIndex(uint32 x, uint32 y)
const;
78 FORCEINLINE uint32 posToIndex(
const Position& position)
const;
Dim dim() const
Definition: Grid.h:29
static Position center(uint32 width, uint32 height)
Definition: Grid.h:23
Definition: SnakeGame.Build.cs:6