]> git.sesse.net Git - stockfish/blob - src/depth.h
Use size_t instead of int
[stockfish] / src / depth.h
1 /*
2   Glaurung, a UCI chess playing engine.
3   Copyright (C) 2004-2008 Tord Romstad
4
5   Glaurung is free software: you can redistribute it and/or modify
6   it under the terms of the GNU General Public License as published by
7   the Free Software Foundation, either version 3 of the License, or
8   (at your option) any later version.
9   
10   Glaurung is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   GNU General Public License for more details.
14   
15   You should have received a copy of the GNU General Public License
16   along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18
19
20 #if !defined(DEPTH_H_INCLUDED)
21 #define DEPTH_H_INCLUDED
22
23 ////
24 //// Types
25 ////
26
27 enum Depth {
28   DEPTH_ZERO = 0,
29   DEPTH_MAX = 200  // 100 * OnePly;
30 };
31
32
33 ////
34 //// Constants
35 ////
36
37 /// Note: If OnePly is changed, the constant HistoryMax in history.h should
38 /// probably also be changed.
39
40 const Depth OnePly = Depth(2);
41
42
43 ////
44 //// Inline functions
45 ////
46
47 inline Depth operator+ (Depth d, int i) { return Depth(int(d) + i); }
48 inline Depth operator+ (Depth d1, Depth d2) { return Depth(int(d1) + int(d2)); }
49 inline void operator+= (Depth &d, int i) { d = Depth(int(d) + i); }
50 inline void operator+= (Depth &d1, Depth d2) { d1 += int(d2); }
51 inline Depth operator- (Depth d, int i) { return Depth(int(d) - i); }
52 inline Depth operator- (Depth d1, Depth d2) { return Depth(int(d1) - int(d2)); }
53 inline void operator-= (Depth & d, int i) { d = Depth(int(d) - i); }
54 inline Depth operator* (Depth d, int i) { return Depth(int(d) * i); }
55 inline Depth operator* (int i, Depth d) { return Depth(int(d) * i); }
56 inline void operator*= (Depth &d, int i) { d = Depth(int(d) * i); }
57 inline Depth operator/ (Depth d, int i) { return Depth(int(d) / i); }
58 inline void operator/= (Depth &d, int i) { d = Depth(int(d) / i); }
59
60
61 #endif // !defined(DEPTH_H_INCLUDED)