DU CODE Snake Competition
 
Loading...
Searching...
No Matches
pos.h
1#pragma once
2
3#include "direction.h"
4#include "stdexcept"
5#include <iostream>
6
9class Pos {
10public:
11 int x;
12 int y;
13 Pos(int x, int y);
14 bool operator==(const Pos &other) const;
15
27 Pos with_dir(const Direction dir) const;
28};
29
30std::ostream &operator<<(std::ostream &os, const Pos &pos);
Pos represents a position on the Grid; the origin is bottom left.
Definition pos.h:9
Pos with_dir(const Direction dir) const
Helper method to give the position if it went in a certain direction.
Definition pos.cpp:14
Direction
Represents a direction and is returned by your bot in MyBot::think.
Definition direction.h:9