fix infinite check bug
[rofl0r-oopoker.git] / ai.h
blobee7b74b40155d4c2e83418b8ef4cad7c3d2a2ca3
1 /*
2 OOPoker
4 Copyright (c) 2010 Lode Vandevenne
5 All rights reserved.
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/>.
23 #pragma once
25 #include "action.h"
27 struct Event;
28 struct Info;
30 class AI //interface class, used for bots, but also for human players (then the AI uses human input instead of calculating itself)
32 public:
34 virtual ~AI(){}
37 doTurn:
38 make a decision for this turn: fold, check, call or raise?
40 virtual Action doTurn(const Info& info) = 0;
43 onEvent:
44 process events if needed (not required, can be used for extra information)
46 virtual void onEvent(const Event& event);
49 boastCards:
50 called at the end of a deal, only if this AI wasn't required to show his cards.
52 virtual bool boastCards(const Info& info);
55 wantsToLeave:
56 sometimes you get a choice to leave the table. NOTE: in OOPoker this is allowed only for human players. So
57 this function will never be called on non-human AI's, but it's still possible to implement it.
58 Return true if you want to leave the table, false otherwise.
60 virtual bool wantsToLeave(const Info& info);
63 getAIName:
64 This is not the name of the player, but the name of his "type of brains".
66 virtual std::string getAIName() = 0;