-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.cpp
74 lines (59 loc) · 2.07 KB
/
Game.cpp
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//
// Game.cpp
// hw5
//
// Created by Ester Park on 2/26/19.
// Copyright © 2019 Ester Park. All rights reserved.
//
#include "Game.hpp"
namespace ECE141 {
class RicksGame : public Game {
public:
virtual ~RicksGame;
RickgsGame() {
initializeTiles();
initializePieces();
}
bool gameIsRunning() {
//return t/f whether soeone won or forfieted..
return true;
}
Game& run(Player &aPlayer1, Player &aPlayer2) {
activePlayer=&aPlayer1;
//if game is running, tell player to make decision
while(gamIsRunning() ) {
activePlayer->takeTurn(*this);
activePlayer=(activePlayer==&aPlayer1) ? activePlayer=&aPlayer2 :
activePlayer=&aPlayer1;
}
}
size_t countAvailablePieces(PieceColor aColor) {}
const Piece* getPlayerPiece(PieceColor aColor, int anIndex) {
}
bool validLocatoin(const Location &aLocation) {
//ensure location.row and col are within bounds
}
//what if get location on player, just to right is 2 right and 2 up, if wanna make a move
//and jump of the board then thats a forfiet
const Tile* getTileAt(const Location &aLocation) {
if(validLocation(aLocation)) {
reutrn &tiles[aLocation.row][aLocation.col];
}
return nullptr;
}
movePieceTo(const Piece &aPiece, const Location &aLocation) {
if(validLocation(aLocation)){
}
//activePlayer forfiets bc of a bad move;;;
//if you got to the kind row, have to make him king
//if jump
};
std::vector<Piece*> goldPieces;
std::vector<Piece*> bluePieces;
std::vector<Tiles> tiles[kBoardHeight];
Player *activePlayer;
};
Game* Game::create() {
return new RicksGame();
}
}