public class BasicState extends Object implements GameState
| Constructor and Description | 
|---|
BasicState(BasicState state)  | 
BasicState(int playerCount)  | 
BasicState(int handSize,
          int playerCount)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addEvent(GameEvent event)  | 
void | 
addToDiscard(Card card)  | 
void | 
deal(int playerID)  | 
Card | 
drawFromDeck()  | 
boolean | 
equals(Object o)  | 
Card | 
getCardAt(int player,
         int slot)  | 
GameState | 
getCopy()  | 
Deck | 
getDeck()  | 
Collection<Card> | 
getDiscards()  | 
Hand | 
getHand(int player)  | 
int | 
getHandSize()  | 
LinkedList<GameEvent> | 
getHistory()  | 
int | 
getInfomation()  | 
int | 
getLives()  | 
Hand | 
getPerspective(int playerID)
Get a version of the hand for a given player, with information about their hand removed. 
 | 
int | 
getPlayerCount()  | 
int | 
getScore()  | 
int | 
getStartingInfomation()  | 
int | 
getStartingLives()  | 
int | 
getTableValue(CardColour colour)  | 
int | 
hashCode()  | 
void | 
init()  | 
void | 
init(Long seed)  | 
boolean | 
isGameOver()  | 
void | 
setCardAt(int player,
         int slot,
         Card card)  | 
void | 
setInformation(int newValue)  | 
void | 
setKnownValue(int player,
             int slot,
             Integer value,
             CardColour colour)  | 
void | 
setLives(int newValue)  | 
void | 
setTableValue(CardColour colour,
             int value)  | 
void | 
tick()  | 
public BasicState(BasicState state)
public BasicState(int playerCount)
public BasicState(int handSize,
                  int playerCount)
public Hand getPerspective(int playerID)
The server side should never need to use this - as only updates are sent to each client they should not see any information they are not permitted to see.
It's mostly good for simulation-based approaches.
playerID - the playerID of the hand you want to accesspublic void addToDiscard(Card card)
addToDiscard in interface GameStatepublic Card drawFromDeck()
drawFromDeck in interface GameStatepublic Card getCardAt(int player, int slot)
public Collection<Card> getDiscards()
getDiscards in interface GameStatepublic int getHandSize()
getHandSize in interface GameStatepublic int getInfomation()
getInfomation in interface GameStatepublic int getPlayerCount()
getPlayerCount in interface GameStatepublic int getStartingInfomation()
getStartingInfomation in interface GameStatepublic int getStartingLives()
getStartingLives in interface GameStatepublic int getTableValue(CardColour colour)
getTableValue in interface GameStatepublic boolean isGameOver()
isGameOver in interface GameStatepublic void setCardAt(int player,
                      int slot,
                      Card card)
public void setInformation(int newValue)
setInformation in interface GameStatepublic void setKnownValue(int player,
                          int slot,
                          Integer value,
                          CardColour colour)
setKnownValue in interface GameStatepublic void setTableValue(CardColour colour, int value)
setTableValue in interface GameStatepublic LinkedList<GameEvent> getHistory()
getHistory in interface GameStateCopyright © 2017 FOSS Galaxy. All rights reserved.