Class EmptyRules

  • All Implemented Interfaces:
    Rules

    public class EmptyRules
    extends java.lang.Object
    implements Rules
    • Constructor Detail

      • EmptyRules

        public EmptyRules()
    • Method Detail

      • getRegionType

        public RegionType getRegionType​(StringID id,
                                        boolean add)
        Description copied from interface: Rules
        Returns the region type with given id. If there is no such skill type and add == true, a new skill type is added and returns. Otherwise, null is returned.
        Specified by:
        getRegionType in interface Rules
      • getRegionTypeIterator

        public java.util.Iterator<RegionType> getRegionTypeIterator()
        Description copied from interface: Rules
        Returns an iterator over all region types.
        Specified by:
        getRegionTypeIterator in interface Rules
      • getRegionTypes

        public java.util.Collection<RegionType> getRegionTypes()
        Description copied from interface: Rules
        Returns a collection of all region types.
        Specified by:
        getRegionTypes in interface Rules
      • getRegionType

        public RegionType getRegionType​(java.lang.String id,
                                        boolean add)
        Description copied from interface: Rules
        get RegionType by (possibly localized) name.
        Specified by:
        getRegionType in interface Rules
      • getRegionType

        public RegionType getRegionType​(java.lang.String id)
        Description copied from interface: Rules
        Shorthand for getRegionType(id, false);
        Specified by:
        getRegionType in interface Rules
      • getRace

        public Race getRace​(StringID id)
        Description copied from interface: Rules
        Shorthand for getRace(id, false)
        Specified by:
        getRace in interface Rules
      • getRace

        public Race getRace​(StringID id,
                            boolean add)
        Description copied from interface: Rules
        Returns the race with given id. If there is no such skill type and add == true, a new skill type is added and returns. Otherwise, null is returned.
        Specified by:
        getRace in interface Rules
      • getRaceIterator

        public java.util.Iterator<Race> getRaceIterator()
        Description copied from interface: Rules
        Returns an iterator over all races.
        Specified by:
        getRaceIterator in interface Rules
      • getRaces

        public java.util.Collection<Race> getRaces()
        Description copied from interface: Rules
        Returns an iterator over all races.
        Specified by:
        getRaces in interface Rules
      • getRace

        public Race getRace​(java.lang.String id,
                            boolean add)
        Description copied from interface: Rules
        get Race by (possibly localized) name
        Specified by:
        getRace in interface Rules
      • getRace

        public Race getRace​(java.lang.String id)
        Description copied from interface: Rules
        shorthand for getRace(id, false)
        Specified by:
        getRace in interface Rules
      • getShipType

        public ShipType getShipType​(StringID id)
        Description copied from interface: Rules
        Shorthand for getShipType(id, false)
        Specified by:
        getShipType in interface Rules
      • getShipType

        public ShipType getShipType​(StringID id,
                                    boolean add)
        Description copied from interface: Rules
        Returns the ship type with given id. If there is no such skill type and add == true, a new skill type is added and returns. Otherwise, null is returned.
        Specified by:
        getShipType in interface Rules
      • getShipTypeIterator

        public java.util.Iterator<ShipType> getShipTypeIterator()
        Description copied from interface: Rules
        Returns an iterator over all ship types.
        Specified by:
        getShipTypeIterator in interface Rules
      • getShipTypes

        public java.util.Collection<ShipType> getShipTypes()
        Description copied from interface: Rules
        Returns an collection of all ship types.
        Specified by:
        getShipTypes in interface Rules
      • getShipType

        public ShipType getShipType​(java.lang.String id,
                                    boolean add)
        Description copied from interface: Rules
        get ShipType by (possibly localized) name
        Specified by:
        getShipType in interface Rules
      • getShipType

        public ShipType getShipType​(java.lang.String id)
        Description copied from interface: Rules
        Shorthand for getShipType(id, false)
        Specified by:
        getShipType in interface Rules
      • getBuildingType

        public BuildingType getBuildingType​(StringID id,
                                            boolean add)
        Description copied from interface: Rules
        Returns the building type with given id. If there is no such skill type and add == true, a new skill type is added and returns. Otherwise, null is returned.
        Specified by:
        getBuildingType in interface Rules
      • getBuildingTypeIterator

        public java.util.Iterator<BuildingType> getBuildingTypeIterator()
        Description copied from interface: Rules
        Returns an iterator over all building types (including CastleTypes).
        Specified by:
        getBuildingTypeIterator in interface Rules
      • getBuildingTypes

        public java.util.Collection<BuildingType> getBuildingTypes()
        Description copied from interface: Rules
        Returns a collection of all building types (including CastleTypes).
        Specified by:
        getBuildingTypes in interface Rules
      • getBuildingType

        public BuildingType getBuildingType​(java.lang.String id,
                                            boolean add)
        Description copied from interface: Rules
        get BuildingType by (possibly localized) name
        Specified by:
        getBuildingType in interface Rules
      • getBuildingType

        public BuildingType getBuildingType​(java.lang.String id)
        Description copied from interface: Rules
        Shorthand for getBuildingType(id, false)
        Specified by:
        getBuildingType in interface Rules
      • getCastleType

        public CastleType getCastleType​(StringID id,
                                        boolean add)
        Description copied from interface: Rules
        Returns the castle type with given id. If there is no such skill type and add == true, a new skill type is added and returns. Otherwise, null is returned.
        Specified by:
        getCastleType in interface Rules
      • getCastleTypeIterator

        public java.util.Iterator<CastleType> getCastleTypeIterator()
        Description copied from interface: Rules
        Returns an iterator of all castle types.
        Specified by:
        getCastleTypeIterator in interface Rules
      • getCastleTypes

        public java.util.Collection<CastleType> getCastleTypes()
        Description copied from interface: Rules
        Returns a collection of all castle types.
        Specified by:
        getCastleTypes in interface Rules
      • getCastleType

        public CastleType getCastleType​(java.lang.String id,
                                        boolean add)
        Description copied from interface: Rules
        get CastleType by (possibly localized) name
        Specified by:
        getCastleType in interface Rules
      • getCastleType

        public CastleType getCastleType​(java.lang.String id)
        Description copied from interface: Rules
        Shorthand for getCastleType(id, false)
        Specified by:
        getCastleType in interface Rules
      • getItemType

        public ItemType getItemType​(StringID id)
        Description copied from interface: Rules
        Shorthand for getItemType(id, false)
        Specified by:
        getItemType in interface Rules
      • getItemType

        public ItemType getItemType​(StringID id,
                                    boolean add)
        Description copied from interface: Rules
        Returns the item type with given id. If there is no such skill type and add == true, a new skill type is added and returns. Otherwise, null is returned.
        Specified by:
        getItemType in interface Rules
      • getItemTypeIterator

        public java.util.Iterator<ItemType> getItemTypeIterator()
        Description copied from interface: Rules
        Returns an iterator over all item types.
        Specified by:
        getItemTypeIterator in interface Rules
      • getItemTypes

        public java.util.Collection<ItemType> getItemTypes()
        Description copied from interface: Rules
        Returns a collection of all item types.
        Specified by:
        getItemTypes in interface Rules
      • getItemType

        public ItemType getItemType​(java.lang.String id,
                                    boolean add)
        Description copied from interface: Rules
        get ItemType by (possibly localized) name
        Specified by:
        getItemType in interface Rules
        Parameters:
        id - An id, like "Silber".
        add - If this is true, a type will be added if it does not exist, yet.
        Returns:
        The item type corresponding to the id or null if the type is unknown or id is null or empty.
      • getItemType

        public ItemType getItemType​(java.lang.String id)
        Description copied from interface: Rules
        Shorthand for getItemType(id, false).
        Specified by:
        getItemType in interface Rules
        Parameters:
        id - An id, like "Silber".
        Returns:
        The item type corresponding to the id or null if the type is unknown.
      • getSkillType

        public SkillType getSkillType​(StringID id)
        Description copied from interface: Rules
        Returns the skill type with the given id.
        Specified by:
        getSkillType in interface Rules
        Returns:
        the skill type with the given id or null if there is no such skill type.
      • getSkillType

        public SkillType getSkillType​(StringID id,
                                      boolean add)
        Description copied from interface: Rules
        Returns the skill type with given id. If there is no such skill type and add == true, a new skill type is added and returns. Otherwise, null is returned.
        Specified by:
        getSkillType in interface Rules
      • getSkillTypeIterator

        public java.util.Iterator<SkillType> getSkillTypeIterator()
        Description copied from interface: Rules
        Returns an iterator over all skill types.
        Specified by:
        getSkillTypeIterator in interface Rules
      • getSkillTypes

        public java.util.Collection<SkillType> getSkillTypes()
        Description copied from interface: Rules
        Returns a collection of all skill types.
        Specified by:
        getSkillTypes in interface Rules
      • getSkillType

        public SkillType getSkillType​(java.lang.String id,
                                      boolean add)
        Description copied from interface: Rules
        get SkillType by (possibly localized) name
        Specified by:
        getSkillType in interface Rules
      • getSkillType

        public SkillType getSkillType​(java.lang.String id)
        Description copied from interface: Rules
        Shorthand for getSkillType(id, false)
        Specified by:
        getSkillType in interface Rules
      • getItemCategory

        public ItemCategory getItemCategory​(StringID id,
                                            boolean add)
        Description copied from interface: Rules
        Returns the item category with given id. If there is no such skill type and add == true, a new skill type is added and returns. Otherwise, null is returned.
        Specified by:
        getItemCategory in interface Rules
      • getItemCategoryIterator

        public java.util.Iterator<ItemCategory> getItemCategoryIterator()
        Description copied from interface: Rules
        Returns an iterator over all item categories.
        Specified by:
        getItemCategoryIterator in interface Rules
      • getItemCategories

        public java.util.Collection<ItemCategory> getItemCategories()
        Description copied from interface: Rules
        Returns a collection of all item categories.
        Specified by:
        getItemCategories in interface Rules
      • getItemCategory

        public ItemCategory getItemCategory​(java.lang.String id,
                                            boolean add)
        Description copied from interface: Rules
        get ItemCategory by (possibly localized) name
        Specified by:
        getItemCategory in interface Rules
      • getItemCategory

        public ItemCategory getItemCategory​(java.lang.String id)
        Description copied from interface: Rules
        Shorthand for getItemCategory(id, false)
        Specified by:
        getItemCategory in interface Rules
      • getSkillCategory

        public SkillCategory getSkillCategory​(StringID id,
                                              boolean add)
        Description copied from interface: Rules
        Returns the skill category with given id. If there is no such skill type and add == true, a new skill type is added and returns. Otherwise, null is returned.
        Specified by:
        getSkillCategory in interface Rules
      • getSkillCategoryIterator

        public java.util.Iterator<SkillCategory> getSkillCategoryIterator()
        Description copied from interface: Rules
        Returns an iterator over all skill categories.
        Specified by:
        getSkillCategoryIterator in interface Rules
      • getSkillCategories

        public java.util.Collection<SkillCategory> getSkillCategories()
        Description copied from interface: Rules
        Returns a collection of all skill categories.
        Specified by:
        getSkillCategories in interface Rules
      • getSkillCategory

        public SkillCategory getSkillCategory​(java.lang.String id,
                                              boolean add)
        Description copied from interface: Rules
        get SkillCategory by (possibly localized) name
        Specified by:
        getSkillCategory in interface Rules
      • getSkillCategory

        public SkillCategory getSkillCategory​(java.lang.String id)
        Description copied from interface: Rules
        Shorthand for getSkillCategory(id, false)
        Specified by:
        getSkillCategory in interface Rules
      • getOptionCategory

        public OptionCategory getOptionCategory​(StringID id,
                                                boolean add)
        Description copied from interface: Rules
        Returns the option category with given id. If there is no such skill type and add == true, a new skill type is added and returns. Otherwise, null is returned.
        Specified by:
        getOptionCategory in interface Rules
      • getOptionCategoryIterator

        public java.util.Iterator<OptionCategory> getOptionCategoryIterator()
        Description copied from interface: Rules
        Returns an iterator over all option categories.
        Specified by:
        getOptionCategoryIterator in interface Rules
      • getOptionCategories

        public java.util.Collection<OptionCategory> getOptionCategories()
        Description copied from interface: Rules
        Returns a collection of all option categories.
        Specified by:
        getOptionCategories in interface Rules
      • getOptionCategory

        public OptionCategory getOptionCategory​(java.lang.String id,
                                                boolean add)
        Description copied from interface: Rules
        get OptionCategory by (possibly localized) name
        Specified by:
        getOptionCategory in interface Rules
      • getOptionCategory

        public OptionCategory getOptionCategory​(java.lang.String id)
        Description copied from interface: Rules
        Shorthand for getOptionCategory(id, false)
        Specified by:
        getOptionCategory in interface Rules
      • getAllianceCategory

        public AllianceCategory getAllianceCategory​(StringID id,
                                                    boolean add)
        Description copied from interface: Rules
        Returns the alliance category with the given id. If add is true and the id is not available, it will be added
        Specified by:
        getAllianceCategory in interface Rules
      • getAllianceCategories

        public java.util.Collection<AllianceCategory> getAllianceCategories()
        Description copied from interface: Rules
        Returns a list of all possible alliance categories.
        Specified by:
        getAllianceCategories in interface Rules
      • getAllianceCategory

        public AllianceCategory getAllianceCategory​(java.lang.String id,
                                                    boolean add)
        Description copied from interface: Rules
        get AllianceCategory by (possibly localized) name
        Specified by:
        getAllianceCategory in interface Rules
      • getAllianceCategory

        public AllianceCategory getAllianceCategory​(java.lang.String id)
        Description copied from interface: Rules
        get AllianceCategory by (possibly localized) name
        Specified by:
        getAllianceCategory in interface Rules
      • changeName

        public ObjectType changeName​(java.lang.String from,
                                     java.lang.String to)
        Description copied from interface: Rules
        Changes the name of an object identified by the given old name.
        Specified by:
        changeName in interface Rules
        Returns:
        the modified object type or null, if no object type is registered with the specified id.
      • setGameSpecificStuffClassName

        public void setGameSpecificStuffClassName​(java.lang.String className)
                                           throws java.io.IOException
        Description copied from interface: Rules
        Returns the GameSpecificStuff object for the name specified by setGameSpecificClassName.
        Specified by:
        setGameSpecificStuffClassName in interface Rules
        Throws:
        java.io.IOException - If rules are not readable
      • getGameSpecificStuff

        public GameSpecificStuff getGameSpecificStuff()
        Description copied from interface: Rules
        Returns the GameSpecificStuff object for the name specified by setGameSpecificClassName.
        Specified by:
        getGameSpecificStuff in interface Rules
      • getOrderfileStartingString

        public java.lang.String getOrderfileStartingString()
        Description copied from interface: Rules
        Gets the game specific string with which order files should start.
        Specified by:
        getOrderfileStartingString in interface Rules
        Returns:
        the game specific line with which order files should start, not including line break
      • setOrderfileStartingString

        public void setOrderfileStartingString​(java.lang.String startingString)
        Description copied from interface: Rules
        Sets the game specific string with which order files should start.
        Specified by:
        setOrderfileStartingString in interface Rules
      • getOrder

        public OrderType getOrder​(StringID id)
        Description copied from interface: Rules
        Returns the order type with the given id.
        Specified by:
        getOrder in interface Rules
      • getOrder

        public OrderType getOrder​(StringID id,
                                  boolean add)
        Description copied from interface: Rules
        Returns the order type with the given id. If add is true and the id is not available, it will be added.
        Specified by:
        getOrder in interface Rules
      • getOrders

        public java.util.Collection<OrderType> getOrders()
        Description copied from interface: Rules
        Returns all orders.
        Specified by:
        getOrders in interface Rules