Exemple #1
0
        void UnReserve(Actor self)
        {
            if (reservedForAircraft != null)
            {
                if (reservedForAircraft.GetActorBelow() == self)
                {
                    if (rallyPoint != null)
                    {
                        reservedFor.QueueActivity(reservedForAircraft.MoveTo(rallyPoint.Location, null, targetLineColor: Color.Green));
                    }
                    else
                    {
                        reservedFor.QueueActivity(new TakeOff(reservedFor));
                    }
                }

                reservedForAircraft.UnReserve();
            }
        }
Exemple #2
0
        void UnReserve(Actor self)
        {
            if (reservedForAircraft != null)
            {
                if (reservedForAircraft.GetActorBelow() == self)
                {
                    if (rallyPoint != null && rallyPoint.Path.Count > 0)
                    {
                        foreach (var cell in rallyPoint.Path)
                        {
                            reservedFor.QueueActivity(new AttackMoveActivity(reservedFor, () => reservedForAircraft.MoveTo(cell, 1, targetLineColor: Color.OrangeRed)));
                        }
                    }
                    else
                    {
                        reservedFor.QueueActivity(new TakeOff(reservedFor));
                    }
                }

                reservedForAircraft.UnReserve();
            }
        }
Exemple #3
0
        void UnReserve(Actor self)
        {
            if (reservedForAircraft != null)
            {
                if (reservedForAircraft.GetActorBelow() == self)
                {
                    // HACK: Cache this in a local var, such that the inner activity of AttackMoveActivity can access the trait easily after reservedForAircraft was nulled
                    var aircraft = reservedForAircraft;
                    if (rallyPoint != null && rallyPoint.Path.Count > 0)
                    {
                        foreach (var cell in rallyPoint.Path)
                        {
                            reservedFor.QueueActivity(new AttackMoveActivity(reservedFor, () => aircraft.MoveTo(cell, 1, targetLineColor: Color.OrangeRed)));
                        }
                    }
                    else
                    {
                        reservedFor.QueueActivity(new TakeOff(reservedFor));
                    }
                }

                reservedForAircraft.UnReserve();
            }
        }