Client engine should now be completely thread safe. const int& -> int. Player CardsValue is now returned as copy, not the array itself.

This commit is contained in:
lotodore
2007-06-11 17:48:22 +00:00
parent dfffa16565
commit 07dc39d107
30 changed files with 1128 additions and 225 deletions
+11 -7
View File
@@ -20,12 +20,14 @@
#define CLIENTBOARD_H
#include <boardinterface.h>
#include <boost/thread.hpp>
class PlayerInterface;
class HandInterface;
class ClientBoard : public BoardInterface{
class ClientBoard : public BoardInterface
{
public:
ClientBoard();
~ClientBoard();
@@ -33,18 +35,20 @@ public:
void setPlayer(PlayerInterface**);
void setHand(HandInterface*);
void setMyCards(int* theValue) { int i; for(i=0; i<5; i++) myCards[i] = theValue[i]; }
void getMyCards(int* theValue) { int i; for(i=0; i<5; i++) theValue[i] = myCards[i]; }
void setMyCards(int* theValue);
void getMyCards(int* theValue);
int getPot() const { return pot;}
void setPot(int theValue) { pot = theValue;}
int getSets() const { return sets; }
void setSets(int theValue) { sets = theValue; }
int getPot() const;
void setPot(int theValue);
int getSets() const;
void setSets(int theValue);
void collectSets();
void collectPot();
private:
mutable boost::recursive_mutex m_syncMutex;
PlayerInterface **playerArray;
HandInterface *actualHand;