Package breitband.game.board
Class Contract
- java.lang.Object
-
- breitband.game.board.Contract
-
- Direct Known Subclasses:
CityContract
,RegionContract
public abstract class Contract extends java.lang.Object
Class containing all information and methods relevant for all contracts regardless of type- Author:
- Klara Schöbel
-
-
Constructor Summary
Constructors Constructor Description Contract(java.lang.String id, int value)
constructs a contract with an id and a value
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getCID()
getter for cIDjava.lang.String
getHash()
getter for hashint
getPlayer()
getter for playerIDint
getValue()
getter for Valueboolean
isDone()
"getter" for donevoid
setDone()
setter for done (takes no input as a contract should only be set from not done to done)void
setPlayer(int playerID)
setter for playerID
-
-
-
Constructor Detail
-
Contract
public Contract(java.lang.String id, int value)
constructs a contract with an id and a value- Parameters:
id
- ID of the contract (see alsogetCID()
)value
- Wert des Vertrags (see alsogetValue()
)
-
-
Method Detail
-
getPlayer
public int getPlayer()
getter for playerID- Returns:
- if of player who owns this contract
-
setPlayer
public void setPlayer(int playerID)
setter for playerID- Parameters:
playerID
- id of player who now owns this contract
-
getCID
public java.lang.String getCID()
getter for cID- Returns:
- ID of this contract
-
isDone
public boolean isDone()
"getter" for done- Returns:
- if the contract is done
-
getValue
public int getValue()
getter for Value- Returns:
- value of this contract
-
setDone
public void setDone()
setter for done (takes no input as a contract should only be set from not done to done)
-
getHash
public java.lang.String getHash()
getter for hash- Returns:
- ID of the contract as it fulfills all the requirements for hash-values
-
-