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 GameState
public Card drawFromDeck()
drawFromDeck
in interface GameState
public Card getCardAt(int player, int slot)
public Collection<Card> getDiscards()
getDiscards
in interface GameState
public int getHandSize()
getHandSize
in interface GameState
public int getInfomation()
getInfomation
in interface GameState
public int getPlayerCount()
getPlayerCount
in interface GameState
public int getStartingInfomation()
getStartingInfomation
in interface GameState
public int getStartingLives()
getStartingLives
in interface GameState
public int getTableValue(CardColour colour)
getTableValue
in interface GameState
public boolean isGameOver()
isGameOver
in interface GameState
public void setCardAt(int player, int slot, Card card)
public void setInformation(int newValue)
setInformation
in interface GameState
public void setKnownValue(int player, int slot, Integer value, CardColour colour)
setKnownValue
in interface GameState
public void setTableValue(CardColour colour, int value)
setTableValue
in interface GameState
public LinkedList<GameEvent> getHistory()
getHistory
in interface GameState
Copyright © 2017 FOSS Galaxy. All rights reserved.