Class 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 canCrossBorders
      java.util.Vector<CableConfig> getCrossCables()
      getter for canCrossCables
      int getDistancePerCable()
      getter for distancePerCable
      java.lang.String getEmoji()
      getter for emoji
      static int getEndingLength()
      getter for endingLength
      java.lang.String getFontAwesome()
      getter for fontAwesome
      int getMaxDistance()
      getter for maxDistance
      java.lang.String getType()
      getter for type
      int getValue()
      getter for value
      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
      static void setEndingLength​(int length)
      this method is only to be used once in the beginning when parsing the config
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 also getType())
        distance - distance per Cable (See also getDistancePerCable())
        maxDistance - max Distance possible with this Cable type (See also getMaxDistance())
        value - value for this cable ype (See also getValue())
        crossBorders - boolean stating if crossing Borders is allowed with this type (See also getCrossBorders())
        fontAwesome - fontAwesome icon of this cableType (see also getFontAwesome())
        emoji - emoji of this cableType (see also getEmoji())
    • 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