-
Notifications
You must be signed in to change notification settings - Fork 17
/
CMoveList.h
51 lines (38 loc) · 1.09 KB
/
CMoveList.h
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
#ifndef _C_MOVELIST_H_
#define _C_MOVELIST_H_
#include <iostream>
#include <vector>
#include "CMove.h"
/***************************************************************
* declaration of CMoveList
*
* This is a wrapper for the std::vector class.
* It contains an array of moves.
***************************************************************/
class CMoveList
{
public:
CMoveList()
{
// Pre-allocate space for a large number of moves.
// This is a slight optimization.
m_moveList.reserve(100);
}
friend std::ostream& operator <<(std::ostream &os, const CMoveList &rhs);
void push_back(const CMove& move)
{
m_moveList.push_back(move);
}
void clear()
{
m_moveList.clear();
}
unsigned int size() const
{
return m_moveList.size();
}
const CMove & operator [] (unsigned int ix) const { return m_moveList[ix]; }
private:
std::vector<CMove> m_moveList;
}; /* end of CMoveList */
#endif // _C_MOVELIST_H_