Package breitband.game.board
Class CableConfig
- java.lang.Object
-
- breitband.game.board.CableConfig
-
public class CableConfig extends java.lang.Object
Class for Cable(-types) (similar to a struct in C)- Author:
- Klara Schöbel
-
-
Constructor Summary
Constructors Constructor Description CableConfig(java.lang.String type, int distance, int maxDistance, int value, boolean crossBorders, java.lang.String fontAwesome, java.lang.String emoji)
Constructs a new Cable (-type) with a type, a distance per cable, maximal distance possible, a value, a fontAwesome and an emoji
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getCrossBorders()
getter for canCrossBordersjava.util.Vector<CableConfig>
getCrossCables()
getter for canCrossCablesint
getDistancePerCable()
getter for distancePerCablejava.lang.String
getEmoji()
getter for emojistatic int
getEndingLength()
getter for endingLengthjava.lang.String
getFontAwesome()
getter for fontAwesomeint
getMaxDistance()
getter for maxDistancejava.lang.String
getType()
getter for typeint
getValue()
getter for valuevoid
setCrossCables(java.util.Vector<CableConfig> crossCables)
Setter für Crosscables, needs to be called at least once since crossCables cannot be initialized in constructor,
because the other cables need to also be initializedstatic void
setEndingLength(int length)
this method is only to be used once in the beginning when parsing the config
-
-
-
Constructor Detail
-
CableConfig
public CableConfig(java.lang.String type, int distance, int maxDistance, int value, boolean crossBorders, java.lang.String fontAwesome, java.lang.String emoji)
Constructs a new Cable (-type) with a type, a distance per cable, maximal distance possible, a value, a fontAwesome and an emoji- Parameters:
type
- type of the Cabletype (See alsogetType()
)distance
- distance per Cable (See alsogetDistancePerCable()
)maxDistance
- max Distance possible with this Cable type (See alsogetMaxDistance()
)value
- value for this cable ype (See alsogetValue()
)crossBorders
- boolean stating if crossing Borders is allowed with this type (See alsogetCrossBorders()
)fontAwesome
- fontAwesome icon of this cableType (see alsogetFontAwesome()
)emoji
- emoji of this cableType (see alsogetEmoji()
)
-
-
Method Detail
-
getEndingLength
public static int getEndingLength()
getter for endingLength- Returns:
- ending-length
-
setEndingLength
public static void setEndingLength(int length)
this method is only to be used once in the beginning when parsing the config- Parameters:
length
- length to set the ending-length to (ending length is max accumulated cable length the game terminates at)
-
getCrossCables
public java.util.Vector<CableConfig> getCrossCables()
getter for canCrossCables- Returns:
- Vector of Cables which can be legally crossed by this type of Cable, is null if no cables can be crossed
-
setCrossCables
public void setCrossCables(java.util.Vector<CableConfig> crossCables)
Setter für Crosscables, needs to be called at least once since crossCables cannot be initialized in constructor,
because the other cables need to also be initialized- Parameters:
crossCables
- vector of all the cables that can be crossed
-
getCrossBorders
public boolean getCrossBorders()
getter for canCrossBorders- Returns:
- if Borders can be crossed with this cable(-type)
-
getType
public java.lang.String getType()
getter for type- Returns:
- type of the cable(-type)
-
getDistancePerCable
public int getDistancePerCable()
getter for distancePerCable- Returns:
- length of the individual cables
-
getMaxDistance
public int getMaxDistance()
getter for maxDistance- Returns:
- maximal distance that can be built using this cable(-type)
-
getValue
public int getValue()
getter for value- Returns:
- value of this cable(-type)
-
getFontAwesome
public java.lang.String getFontAwesome()
getter for fontAwesome- Returns:
- name of FontAwesome Icon
-
getEmoji
public java.lang.String getEmoji()
getter for emoji- Returns:
- name of the Emoji
-
-