Exemplo n.º 1
0
        public bool MoveToFormation(UnitGroup units)
        {
            bool executed = false;

            for (; units.IsValid(); units.TryMoveNext())
            {
                if (MoveToFormation(units.Current))
                {
                    executed = true;
                }
            }
            return(executed);
        }
Exemplo n.º 2
0
        public bool MoveToFormation(UnitGroup units)
        {
            bool executed = false;

            while (units.IsValid())
            {
                if (MoveToFormation(units.Current))
                {
                    executed = true;
                    units.TryMoveNext();
                }
                else if (spiralPositions.ContainingSquareSize >= maxSize)
                {
                    executed = OverflowUnits(units);
                }
            }
            return(executed);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a spiral around the provided tile
        /// </summary>
        /// <param name="units"></param>
        public bool MoveToFormation(UnitGroup units)
        {
            if (units == null)
            {
                return(false);
            }

            bool executed = false;

            while (units.IsValid())
            {
                if (MoveToFormation(units.Current))
                {
                    executed = true;
                }

                if (!units.TryMoveNext())
                {
                    break;
                }
            }
            return(executed);
        }