-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.cpp
More file actions
35 lines (30 loc) · 1.76 KB
/
Player.cpp
File metadata and controls
35 lines (30 loc) · 1.76 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
#include "stdafx.h"
#include "GUI.h"
#include "Player.h"
#include "CConfigurableIntelligenceGameView.h"
#include "utilities.h"
namespace CIG
{
Player::Player( const Player& p, Chessboard* cb)
: makeBestMove(p.makeBestMove), chessboard(cb), NAME(p.NAME), ownedChessmans(p.ownedChessmans)
{
}
Player::Player(CIGRuleConfig::PLAYER_NAMES p, void (*makeBestMove_)(Chessboard* cb, void*) , Chessboard* cb)
: chessboard(cb), NAME(p), ownedChessmans(), makeBestMove(makeBestMove_)
{
}
Player::Player(): chessboard(NULL), NAME((CIGRuleConfig::PLAYER_NAMES) - 1), ownedChessmans(), makeBestMove(GUI::askForMove)
{
}
Player::~Player()
{
}
void Player::operator=( const Player& p )
{
makeBestMove = p.makeBestMove;
chessboard = p.chessboard;
//ownedChessmans = p.ownedChessmans;
ownedChessmans.forceCopyFrom(p.ownedChessmans);
NAME = p.NAME;
}
}