Class MagellanTempUnitImpl

    • Constructor Detail

      • MagellanTempUnitImpl

        public MagellanTempUnitImpl​(UnitID id,
                                    MagellanUnitImpl parent)
        Creates a new TempUnit object.
    • Method Detail

      • setParent

        public void setParent​(Unit u)
        Assigns this temp unit a parent unit.
        Specified by:
        setParent in interface TempUnit
      • getParent

        public Unit getParent()
        Returns the parent of this temp unit. If this is not a temp unit, null is returned.
        Specified by:
        getParent in interface TempUnit
      • toString

        public java.lang.String toString​(boolean withName)
        Returns a string representation of this temporary unit.
        Specified by:
        toString in interface TempUnit
        Specified by:
        toString in interface Unit
        Overrides:
        toString in class MagellanUnitImpl
      • setTempRace

        public void setTempRace​(Race r)
        Description copied from interface: TempUnit
        If the temp unit has a different race than the parent unit, set it here.
        Specified by:
        setTempRace in interface TempUnit
      • getRace

        public Race getRace()
        Description copied from interface: Unit
        Returns race.
        Warning: This should the real race but could be the disguised race!
        Specified by:
        getRace in interface Unit
        Overrides:
        getRace in class MagellanUnitImpl
        Returns:
        Returns race.
        See Also:
        Unit.getRace()