Class EresseaOrderChanger

    • Method Detail

      • getRules

        protected Rules getRules()
      • createNamingOrder

        protected java.lang.String createNamingOrder​(java.lang.String name,
                                                     Unit unit)
      • createNamingOrder

        protected java.lang.String createNamingOrder​(UnitContainer uc,
                                                     java.lang.String name,
                                                     Unit unit)
      • createDescribeUnitContainerOrder

        protected java.lang.String createDescribeUnitContainerOrder​(UnitContainer uc,
                                                                    Unit unit,
                                                                    java.lang.String description)
      • createDescribeUnitPrivateOrder

        protected java.lang.String createDescribeUnitPrivateOrder​(java.lang.String descr,
                                                                  Unit unit)
      • createDescribeUnitOrder

        protected java.lang.String createDescribeUnitOrder​(java.lang.String descr,
                                                           Unit unit)
      • createHideOrder

        protected Order createHideOrder​(Unit unit,
                                        java.lang.String level)
      • getCombatOrder

        protected java.lang.String getCombatOrder​(Unit unit,
                                                  int newState)
      • addMultipleHideOrder

        public void addMultipleHideOrder​(Unit unit)
        Adds camouflage orders, for hiding all that could identify the unit and remembering the old values in comments.
        Specified by:
        addMultipleHideOrder in interface OrderChanger
        Parameters:
        unit - The affected unit.
      • isLongOrder

        public boolean isLongOrder​(Order order)
        Description copied from interface: OrderChanger
        checks, if the given order is a long order
        Specified by:
        isLongOrder in interface OrderChanger
        Returns:
        true if the given order is a long order
      • isLongOrder

        @Deprecated
        public boolean isLongOrder​(java.lang.String order)
        Deprecated.
        The results of this method are not very accurate
        Description copied from interface: OrderChanger
        checks, if the given order is a long order
        Specified by:
        isLongOrder in interface OrderChanger
        Returns:
        true if the given order is a long order
        See Also:
        OrderChanger.isLongOrder(java.lang.String)
      • isLongButShort

        @Deprecated
        protected boolean isLongButShort​(java.lang.String rOrder,
                                         java.util.Locale orderLocale)
        Deprecated.
        Parameters:
        rOrder -
        orderLocale -
        Returns:
      • getLongOrders

        @Deprecated
        protected java.util.ArrayList<java.lang.String> getLongOrders()
        Deprecated.
        List of long orders in the default locale.
      • getLongOrdersTranslated

        protected java.util.ArrayList<java.lang.String> getLongOrdersTranslated()
        List of long orders in the default locale.
      • getLongOrders

        protected java.util.ArrayList<java.lang.String> getLongOrders​(java.util.Locale locale)
        List of long orders in the selected locale.
      • getLongOrderTokens

        protected java.util.ArrayList<StringID> getLongOrderTokens()
        list of long orders in Eressea.
        ARBEITE, ATTACKIERE, BEKLAUE, BELAGERE, FAHRE, FOLGE, FORSCHE, KAUFE, LEHRE, LERNE, MACHE (Ausnahme: MACHE TEMP), NACH, PFLANZE, PIRATERIE, ROUTE, SABOTIERE SCHIFF, SPIONIERE, TREIBE, UNTERHALTE, VERKAUFE, ZAUBERE, ZÜCHTE, ZERSTÖRE.
      • extractTempUnits

        public int extractTempUnits​(GameData gdata,
                                    int tempSortIndex,
                                    java.util.Locale locale,
                                    Unit unit)
        Scans this unit's orders for temp units to create. It constructs them as TempUnit objects and removes the corresponding orders from this unit.
        Specified by:
        extractTempUnits in interface OrderChanger
        Parameters:
        tempSortIndex - an index for sorting units (required to reconstruct the original order in the report) which is incremented with each new temp unit.
        locale - the locale to parse the orders with.
        Returns:
        the new sort index. return value - sortIndex is the number of temp units read from this unit's orders.
      • getTempOrders

        public java.util.Collection<? extends Order> getTempOrders​(boolean writeUnitTagsAsVorlageComment,
                                                                   Unit unit)
        Returns the orders necessary to issue the creation of all the child temp units of this unit.
        Specified by:
        getTempOrders in interface OrderChanger
      • getOrderTranslation

        protected Order getOrderTranslation​(StringID orderId,
                                            Unit unit)
      • getTokenLocalized

        public java.lang.String getTokenLocalized​(java.util.Locale orderLocale,
                                                  java.lang.Object arg)
                                           throws RulesException
        Description copied from interface: OrderChanger
        Returns localized string for given locale and argument.
        Specified by:
        getTokenLocalized in interface OrderChanger
        arg - can be an order ID, a unit ID or anything else
        Throws:
        RulesException - if argument has no translation
      • getOrderO

        public Order getOrderO​(java.util.Locale orderLocale,
                               StringID orderId)
        Description copied from interface: OrderChanger
        Returns localized order for given order id
        Specified by:
        getOrderO in interface OrderChanger
        orderId - an order ID, usually one of the EresseaConstants.OC_... constants.
      • getOrderO

        public Order getOrderO​(java.util.Locale orderLocale,
                               StringID orderId,
                               java.lang.Object[] args)
        Description copied from interface: OrderChanger
        Returns a localized order for given order id concatenated (separated by spaces) with the argument translations.
        Specified by:
        getOrderO in interface OrderChanger
        orderId - an order ID, usually one of the EresseaConstants.OC_... constants.
        args - Additional arguments
        Returns:
        The order
      • getOrderO

        public Order getOrderO​(StringID orderId,
                               java.util.Locale orderLocale)
                        throws RulesException
        Description copied from interface: OrderChanger
        Returns localized order for given order id
        Specified by:
        getOrderO in interface OrderChanger
        Parameters:
        orderId - an order ID, usually one of the EresseaConstants.OC_... constants.
        Throws:
        RulesException - if argument has no translation
      • getOrderO

        public Order getOrderO​(StringID orderId,
                               java.util.Locale orderLocale,
                               java.lang.Object[] args)
                        throws RulesException
        Description copied from interface: OrderChanger
        Returns a localized order for given order id concatenated (separated by spaces) with the argument translations.
        Specified by:
        getOrderO in interface OrderChanger
        Parameters:
        orderId - an order ID, usually one of the EresseaConstants.OC_... constants.
        args - Additional arguments
        Returns:
        The order
        Throws:
        RulesException - if argument has no translation
      • getOrder

        @Deprecated
        public java.lang.String getOrder​(java.util.Locale orderLocale,
                                         StringID orderId)
        Deprecated.
        Description copied from interface: OrderChanger
        Returns localized order for given order id
        Specified by:
        getOrder in interface OrderChanger
        orderId - an order ID, usually one of the EresseaConstants.OC_... constants.
      • getOrder

        @Deprecated
        public java.lang.String getOrder​(java.util.Locale orderLocale,
                                         StringID orderId,
                                         java.lang.Object[] args)
        Deprecated.
        Description copied from interface: OrderChanger
        Returns a localized order for given order id concatenated (separated by spaces) with the argument translations.
        Specified by:
        getOrder in interface OrderChanger
        orderId - an order ID, usually one of the EresseaConstants.OC_... constants.
        args - Additional arguments
        Returns:
        The order
      • getOrder

        @Deprecated
        public java.lang.String getOrder​(StringID orderId,
                                         java.util.Locale orderLocale)
                                  throws RulesException
        Deprecated.
        Description copied from interface: OrderChanger
        Returns localized order for given order id
        Specified by:
        getOrder in interface OrderChanger
        Parameters:
        orderId - an order ID, usually one of the EresseaConstants.OC_... constants.
        Throws:
        RulesException - if argument has no translation
      • getOrder

        @Deprecated
        public java.lang.String getOrder​(StringID orderId,
                                         java.util.Locale orderLocale,
                                         java.lang.Object[] args)
                                  throws RulesException
        Deprecated.
        Description copied from interface: OrderChanger
        Returns a localized order for given order id concatenated (separated by spaces) with the argument translations.
        Specified by:
        getOrder in interface OrderChanger
        Parameters:
        orderId - an order ID, usually one of the EresseaConstants.OC_... constants.
        args - Additional arguments
        Returns:
        The order
        Throws:
        RulesException - if argument has no translation