Enum Europe.MigrationType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Europe.MigrationType>
    Enclosing class:
    Europe

    public static enum Europe.MigrationType
    extends java.lang.Enum<Europe.MigrationType>
    Migration handling. Migration routines operate on: - "indexes" which refer to a valid member of the recruitables list, and must be [0, RECRUIT_COUNT) - "slots", where slot zero means "pick a random migrant" and the other slots in [1, RECRUIT_COUNT] refer to the index == slot-1 The following constant should be used when the random choice behaviour is desired.
    • Field Detail

      • MIGRANT_COUNT

        private static final int MIGRANT_COUNT
        The number of recruitable unit types.
        See Also:
        Constant Field Values
      • CHOOSE_MIGRANT_SLOT

        private static final int CHOOSE_MIGRANT_SLOT
        The unspecific migrant slot to use to denote a random choice between specific slots.
        See Also:
        Constant Field Values
      • DEFAULT_MIGRANT_SLOT

        private static final int DEFAULT_MIGRANT_SLOT
        The migrant slot to use when there is no reason to choose between them.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MigrationType

        private MigrationType()
    • Method Detail

      • values

        public static Europe.MigrationType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Europe.MigrationType c : Europe.MigrationType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Europe.MigrationType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getMigrantCount

        public static int getMigrantCount()
      • getUnspecificSlot

        public static int getUnspecificSlot()
      • getDefaultSlot

        public static int getDefaultSlot()
      • validMigrantIndex

        public static boolean validMigrantIndex​(int x)
      • migrantIndexToSlot

        public static int migrantIndexToSlot​(int x)
      • migrantSlotToIndex

        public static int migrantSlotToIndex​(int x)
      • convertToMigrantSlot

        public static int convertToMigrantSlot​(java.lang.Integer i)
      • validMigrantSlot

        public static boolean validMigrantSlot​(int x)
      • specificMigrantSlot

        public static boolean specificMigrantSlot​(int x)
      • unspecificMigrantSlot

        public static boolean unspecificMigrantSlot​(int x)