4 Copyright (c) 2010 Lode Vandevenne
7 This file is part of OOPoker.
9 OOPoker is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 OOPoker is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with OOPoker. If not, see <http://www.gnu.org/licenses/>.
30 //forward declarations
37 void makeInfo(Info
& info
, const Table
& table
, const Rules
& rules
, int playerViewPoint
);
39 void dividePot(std::vector
<int>& wins
, const std::vector
<int>& bet
, const std::vector
<int>& score
, const std::vector
<bool>& folded
);
40 int getNumActivePlayers(const std::vector
<Player
>& players
);
41 bool betsSettled(int lastRaiseIndex
, int current
, int prev_current
, const std::vector
<Player
>& players
);
47 std::vector
<Player
> playersOut
; //players who quit the table (remembered in order to give the win rankings at the end). Not used if rebuys are allowed, since players then stay.
49 std::vector
<Player
> players
;
50 std::vector
<Observer
*> observers
;
51 std::vector
<Event
> events
;
54 int numDeals
; //how much deals are done since the game started
58 Info infoForPlayers
; //this is to speed up the game a lot, by not recreating the Info object everytime
61 void settleBets(Table
& table
, Rules
& rules
);
62 void kickOutPlayers(Table
& table
);
63 void declareWinners(Table
& table
);
64 void sendEvents(Table
& table
);
65 const Info
& getInfoForPlayers(Table
& table
, int viewPoint
= -1); //rather heavy-weight function! Copies entire Info object.
69 Game(Host
* host
); //The game class will NOT delete the host, you have to clean up this variable yourself if needed.
72 //The Game class will take care of deleting the AI's and observers in its desctructor.
73 void addPlayer(const Player
& player
);
74 void addObserver(Observer
* observer
);
75 void setRules(const Rules
& rules
);
77 void runTable(Table
& table
);