31 Grid(
bool is_player_one,
const int current_tick,
const Cells &cells,
32 const std::vector<Pos> &player_one_segments,
33 const std::vector<Pos> &player_two_segments);
81 const int current_tick;
82 const std::vector<Pos> &player_one_segments;
83 const std::vector<Pos> &player_two_segments;
84 std::vector<Pos> find(
Cell cell)
const;
Cell
Represents every cell on a Grid. Cell is returned by Grid::get.
Definition cell.h:9
Represents the grid of cells containing snakes and fruits. Grid is used in the MyBot::think function ...
Definition grid.h:22
Pos find_other_head() const
Returns the head of the other snake.
Definition grid.cpp:42
std::vector< Pos > find_self_positions() const
Get the ordered positions of all your parts. The first element is the head.
Definition grid.cpp:51
int get_height() const
Returns the height of the grid.
Definition grid.cpp:25
int get_width() const
Returns the width of the grid.
Definition grid.cpp:28
std::vector< Pos > find_other_positions() const
Get the ordered positions of the other snake. The first element is their head.
Definition grid.cpp:60
int get_current_tick() const
Returns the current tick with 0 being the first tick and FINAL_TICK being the last....
Definition grid.cpp:30
std::vector< Pos > find_fruits() const
Returns all fruit as a std::vector<Pos>
Definition grid.cpp:32
Pos find_self_head() const
Get the position of your head.
Definition grid.cpp:34
Cell get(int x, int y) const
Returns a Cell at (x, y) or throws if x and y are invalid.
Definition grid.cpp:12
Pos represents a position on the Grid; the origin is bottom left.
Definition pos.h:9