Class Hex

java.lang.Object
net.sf.colossus.variant.Hex
Direct Known Subclasses:
BattleHex, MasterHex

public abstract class Hex extends Object
Class Hex describes one general hex.
Author:
David Ripton
  • Field Details

    • label

      private final String label
    • xCoord

      private final int xCoord
    • yCoord

      private final int yCoord
  • Constructor Details

    • Hex

      public Hex(String label, int xCoord, int yCoord)
  • Method Details

    • getLabel

      public String getLabel()
    • getTerrainName

      public abstract String getTerrainName()
    • getDescription

      public String getDescription()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getXCoord

      public int getXCoord()
    • getYCoord

      public int getYCoord()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      We consider two hexes equal if their x/y coordinates are the same. This gives equality within the context of a HexMap, since we don't know to which map the Hex belongs we can't do any better.
      Overrides:
      equals in class Object