Class RearrangeColonyMessage.Arrangement

  • Enclosing class:
    RearrangeColonyMessage

    public static class RearrangeColonyMessage.Arrangement
    extends java.lang.Object
    Container for the unit change information.
    • Constructor Detail

      • Arrangement

        public Arrangement()
      • Arrangement

        public Arrangement​(Game game,
                           java.lang.String unitId,
                           java.lang.String locId,
                           java.lang.String workId,
                           java.lang.String roleId,
                           java.lang.String roleCount)
    • Method Detail

      • init

        public final void init​(Game game,
                               java.lang.String unitId,
                               java.lang.String locId,
                               java.lang.String workId,
                               java.lang.String roleId,
                               java.lang.String roleCount)
      • unitKey

        public static java.lang.String unitKey​(int i)
      • locKey

        public static java.lang.String locKey​(int i)
      • workKey

        public static java.lang.String workKey​(int i)
      • roleKey

        public static java.lang.String roleKey​(int i)
      • roleCountKey

        public static java.lang.String roleCountKey​(int i)
      • getArrangements

        public static java.util.List<RearrangeColonyMessage.Arrangement> getArrangements​(Colony colony,
                                                                                         java.util.List<Unit> workers,
                                                                                         Colony scratch)
        Create new arrangements for a given list of worker units on the basis of a scratch colony configuration.
        Parameters:
        colony - The original Colony.
        workers - A list of worker Units to arrange.
        scratch - The scratch Colony.
        Returns:
        A list of Arrangements.
      • roleComparison

        public int roleComparison​(RearrangeColonyMessage.Arrangement other)
        Role comparison for use in rearrangeColony.
        Parameters:
        other - The Arrangement to compare to.
        Returns:
        A comparison value.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object