Fixed player counting bug. Fixed player number. Joining/leaving network game should work now. Added player type to localplayer.

This commit is contained in:
lotodore
2007-05-08 06:45:46 +00:00
parent 5b878d9095
commit 4a10d6188c
14 changed files with 216 additions and 183 deletions
@@ -35,7 +35,7 @@ HandInterface* LocalEngineFactory::createHand(EngineFactory *f, GuiInterface *g,
BoardInterface* LocalEngineFactory::createBoard() { return new LocalBoard; }
PlayerInterface* LocalEngineFactory::createPlayer(BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB) { return new LocalPlayer(b, id, name, avatar, sC, aS, mB); }
PlayerInterface* LocalEngineFactory::createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB) { return new LocalPlayer(b, id, uniqueId, type, name, avatar, sC, aS, mB); }
PreflopInterface* LocalEngineFactory::createPreflop(HandInterface* hi, int id, int aP, int dP, int sB) { return new LocalPreflop(hi, id, aP, dP, sB); }
+1 -1
View File
@@ -39,7 +39,7 @@ public:
HandInterface* createHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, PlayerInterface **p, int id, int sP, int aP, int dP, int sB,int sC);
BoardInterface* createBoard();
PlayerInterface* createPlayer(BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB);
PlayerInterface* createPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
PreflopInterface* createPreflop(HandInterface* hi, int id, int aP, int dP, int sB);
FlopInterface* createFlop(HandInterface* hi, int id, int aP, int dP, int sB);
TurnInterface* createTurn(HandInterface* hi, int id, int aP, int dP, int sB);
+2 -1
View File
@@ -23,7 +23,8 @@
using namespace std;
LocalPlayer::LocalPlayer(BoardInterface *b, int id, std::string name, std::string avatar, int sC, bool aS, int mB) : PlayerInterface(), actualHand(0), actualBoard(b), myCardsValue(0), myID(id), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myAction(0), myButton(mB), myActiveStatus(aS), myTurn(0), myRoundStartCash(0), sBluff(0), sBluffStatus(0)
LocalPlayer::LocalPlayer(BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
: PlayerInterface(), actualHand(0), actualBoard(b), myCardsValue(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myAction(0), myButton(mB), myActiveStatus(aS), myTurn(0), myRoundStartCash(0), sBluff(0), sBluffStatus(0)
{
// for statistic development
+7 -3
View File
@@ -36,14 +36,16 @@ class BoardInterface;
class LocalPlayer : public PlayerInterface{
public:
LocalPlayer(BoardInterface*, int, std::string, std::string, int, bool, int);
LocalPlayer(
BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
~LocalPlayer();
~LocalPlayer();
void setHand(HandInterface*);
void setMyID(const int& theValue) { myID = theValue; }
int getMyID() const { return myID; }
unsigned getMyUniqueID() const { return myUniqueID; }
PlayerType getMyType() const { return myType; }
void setMyDude(const int& theValue) { myDude = theValue; }
int getMyDude() const { return myDude; }
@@ -147,6 +149,8 @@ private:
// Konstanten
int myID;
unsigned myUniqueID;
PlayerType myType;
std::string myName;
std::string myAvatar;
int myDude;
+1 -1
View File
@@ -95,7 +95,7 @@ void LocalPreflop::preflopRun() {
else {
// Preflop ist wirklich dran
// nhsten Spieler ermitteln
// naechsten Spieler ermitteln
do {
playersTurn = (playersTurn+1)%(MAX_NUMBER_OF_PLAYERS);