-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPosition.hpp
More file actions
54 lines (45 loc) · 1.45 KB
/
Position.hpp
File metadata and controls
54 lines (45 loc) · 1.45 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// Position.hpp
// BCAI
//
// Created by Max Botviniev on 13.11.15.
// Copyright © 2015 Max Botviniev. All rights reserved.
//
#ifndef Position_hpp
#define Position_hpp
#include <stdio.h>
#include <iostream>
#include <cmath>
namespace BCAI {
struct Position {
char x;
unsigned int y;
Position( char _x, unsigned int _y ) : x(_x), y(_y) { };
Position & operator = (const Position & other);
bool operator == ( Position & other ) const;
friend std::ostream & operator << (std::ostream & os, Position & pos);
};
//-------------------------
//-------------------------
struct IndexPair {
int x_v = 66;
int y_v = 99;
IndexPair();
IndexPair(int _x_v, int _y_v);
IndexPair( char _x_v, char _y_v );
IndexPair( const IndexPair & other );
IndexPair( const Position & pos );
bool OnBoard();
IndexPair Abs(const IndexPair & other);
IndexPair Normilized();
IndexPair Direction( IndexPair to );
void operator += (const IndexPair & other);
IndexPair operator + (const IndexPair & other);
IndexPair operator - (const IndexPair & other);
void operator = (IndexPair & other);
bool operator == ( IndexPair & other ) const;
bool operator > ( IndexPair & other ) const;
friend std::ostream & operator << (std::ostream & os, const IndexPair & indexes);
};
}
#endif /* Position_hpp */