-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtils.h
More file actions
35 lines (28 loc) · 808 Bytes
/
Copy pathUtils.h
File metadata and controls
35 lines (28 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// Created by Ziyang Zhang on 2019-05-03.
//
#ifndef CHECKER_TEACHER_UTILS_H
#define CHECKER_TEACHER_UTILS_H
#include <exception>
#include <vector>
#include <map>
#include <string>
class Position {
public:
int x;
int y;
Position(int x,int y);
int& operator[] (const int& index);
bool operator== (const Position& lp) const;
bool operator< (const Position& rp) const;
};
class Direction {
public:
const std::map<std::string, const std::vector< Position> > list
{{"W",std::vector<Position>{Position(-1,-1),Position(-1,1)}},{"B",std::vector< Position>{Position(1,-1),Position(1,1)}} };
std::vector<Position> operator[] (const std::string& index);
Direction() = default;
};
class IndexOutOfBoundError : public std::exception {
};
#endif //CHECKER_TEACHER_UTILS_H