ImmutableStatusBuilder

model.status.ImmutableStatusBuilder
class ImmutableStatusBuilder(players: List[Player], stack: List[Card], trump: Option[Card], amount: Int, turn: Turn, defended: List[Card], undefended: List[Card], used: List[Card], denied: Boolean, passed: Option[Player]) extends StatusBuilder

An immutable implementation of model.status.StatusBuilder

Value parameters

amount

the amount of cards each player should have while the stack is non-empty, initially set to 0.

defended

a list of all currently defended cards, initially set to Nil

denied

whether the player with the turn model.turn.FirstlyAttacking denied his attack, initially set to false

passed

the player who initially passed cards of the same rank to the next player, initially set to None

players

a list of all players, initially set to Nil

stack

a list of all cards, representing the stack, initially set to Nil

trump

an Option containing the trump. The trump is the last element on the stack, initially set to None.

turn

the current turn, initially set model.Turn.Uninitialized

undefended

a list of all currently undefended cards, initially set to Nil

used

a list of all currently cards used to defend, initially set to Nil

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Constructors

def this()

Sets all values to their default.

Sets all values to their default.

Attributes

Concrete methods

override def byTurn(turn: Turn): Option[Player]

Retrieves a player by its turn.

Retrieves a player by its turn.

Value parameters

turn

the turn to search for

Attributes

Returns

the player with the specified turn. If no player has the specified turn, None is returned.

Definition Classes
override def getAmount: Int

Retrieves the card amount.

Retrieves the card amount.

Attributes

Returns

the card amount

Definition Classes
override def getDefended: List[Card]

Retrieves the defended cards.

Retrieves the defended cards.

Attributes

Returns

the defended cards

Definition Classes
override def getPassed: Option[Player]

Retrieves the passed player.

Retrieves the passed player.

Attributes

Returns

the passed player. If no player passed, None is returned.

Definition Classes
override def getPlayers: List[Player]

Retrieves the players.

Retrieves the players.

Attributes

Returns

the players

Definition Classes
override def getStack: List[Card]

Retrieves the stack.

Retrieves the stack.

Attributes

Returns

the stack

Definition Classes
override def getTrump: Option[Card]

Retrieves the trump.

Retrieves the trump.

Attributes

Returns

the trump. If no trump is set, None is returned.

Definition Classes
override def getTurn: Turn

Retrieves the current turn.

Retrieves the current turn.

Attributes

Returns

the current turn

Definition Classes
override def getUndefended: List[Card]

Retrieves the undefended cards.

Retrieves the undefended cards.

Attributes

Returns

the undefended cards

Definition Classes
override def getUsed: List[Card]

Retrieves the used cards.

Retrieves the used cards.

Attributes

Returns

the used cards

Definition Classes
override def isDenied: Boolean

Retrieves the denied flag.

Retrieves the denied flag.

Attributes

Returns

the denied flag

Definition Classes
override def removePassed(): StatusBuilder

Sets the passed player to None.

Sets the passed player to None.

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def removeTrump(): StatusBuilder

Sets the trump to None

Sets the trump to None

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def resetRound: StatusBuilder

Resets the rounds by setting the turn to model.Turn.FirstlyAttacking and the defended, undefended and used cards to empty lists. The denied flag is set to false.

Resets the rounds by setting the turn to model.Turn.FirstlyAttacking and the defended, undefended and used cards to empty lists. The denied flag is set to false.

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def setAmount(amount: Int): StatusBuilder

Sets the amount to the specified amount.

Sets the amount to the specified amount.

Value parameters

amount

the amount to set

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def setDefended(defended: List[Card]): StatusBuilder

Sets the defended cards to the specified card list.

Sets the defended cards to the specified card list.

Value parameters

defended

the defended cards to set

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def setDenied(denied: Boolean): StatusBuilder

Sets the denied flag to the specified value.

Sets the denied flag to the specified value.

Value parameters

denied

the denied flag to set

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def setPassed(passed: Player): StatusBuilder

Sets the passed player to the specified player.

Sets the passed player to the specified player.

Value parameters

passed

the passed player to set

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def setPlayers(players: List[Player]): StatusBuilder

Sets the players to the specified player list.

Sets the players to the specified player list.

Value parameters

players

the players to set

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def setStack(stack: List[Card]): StatusBuilder

Sets the stack to the specified card list.

Sets the stack to the specified card list.

Value parameters

stack

the stack to set

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def setStatus(status: Status): StatusBuilder

Sets all values to the values provided by the specified status.

Sets all values to the values provided by the specified status.

Value parameters

status

the status to read from

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def setTrump(trump: Card): StatusBuilder

Sets the trump to the specified card.

Sets the trump to the specified card.

Value parameters

trump

the trump to set

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def setTurn(turn: Turn): StatusBuilder

Sets the turn to the specified turn.

Sets the turn to the specified turn.

Value parameters

turn

the turn to set

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def setUndefended(undefended: List[Card]): StatusBuilder

Sets the undefended cards to the specified card list.

Sets the undefended cards to the specified card list.

Value parameters

undefended

the undefended cards to set

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def setUsed(used: List[Card]): StatusBuilder

Sets the used cards to the specified card list.

Sets the used cards to the specified card list.

Value parameters

used

the used cards to set

Attributes

Returns

an updated model.status.StatusBuilder

Definition Classes
override def status: Status

Builds the status.

Builds the status.

Attributes

Returns

the status

Definition Classes