Package breitband.game.board
Class RegionContract
- java.lang.Object
-
- breitband.game.board.Contract
-
- breitband.game.board.RegionContract
-
public class RegionContract extends Contract
class containing all information regarding only region-contracts- Author:
- Klara Schöbel
-
-
Constructor Summary
Constructors Constructor Description RegionContract(java.lang.String id, int val, Region region)
Constructs a contract with an id, a value and the region
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
Checks if a RegionContract and any object are equal.Region
getRegion()
getter for Regionint
hashCode()
override for the hashCode() method of java.lang.Object
-
-
-
Constructor Detail
-
RegionContract
public RegionContract(java.lang.String id, int val, Region region)
Constructs a contract with an id, a value and the region- Parameters:
id
- id of the contractval
- value of the contractregion
- region of the contract (see alsogetRegion()
)
-
-
Method Detail
-
getRegion
public Region getRegion()
getter for Region- Returns:
- region this contract specifies
-
hashCode
public int hashCode()
override for the hashCode() method of java.lang.Object- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- name of the region
-
equals
public boolean equals(java.lang.Object o)
Checks if a RegionContract and any object are equal.They are only equal if the other object is a RegionContract covering the same region. This is done by comparing the names of the regions.
- Overrides:
equals
in classjava.lang.Object
- Parameters:
o
- The other object to be compared to- Returns:
- Whether both are equal
-
-