Пример #1
0
        public bool Execute(Universe universe)
        {
            squadList.GetMeetingPoint(squadAlfaId, squadDeltaId);

            var meetingPoint = squadList.GetMeetingPoint(squadAlfaId, squadDeltaId);

            actions.ActionSelectSquad(squadAlfaId);
            actions.ActionMoveSelectionToPosition(meetingPoint);
            squadList.GetSquadById(squadAlfaId).UpdateLastCallTime(MyStrategy.Universe.World.TickIndex);

            actions.ActionSelectSquad(squadDeltaId);
            actions.ActionMoveSelectionToPosition(meetingPoint);
            squadList.GetSquadById(squadDeltaId).UpdateLastCallTime(MyStrategy.Universe.World.TickIndex);
            return(true);
        }
Пример #2
0
        internal void DoStop(Queue <IMoveAction> actions)
        {
            actions.ActionSelectSquad(Id);
            actions.ActionMoveSelectionToPosition(SquadCenter);

            UpdateLastCallTime(MyStrategy.Universe.World.TickIndex);
        }
Пример #3
0
 public static void ActionScaleSquadToPosition(this Queue <IMoveAction> actions, Squad squad, double factor, AbsolutePosition position, int duration)
 {
     actions.ActionSelectSquad(squad.Id);
     actions.Enqueue(new ActionScaleSelectedSquadToPosition(squad, factor, position, duration));
     squad.IsWaitingForScaling = true;
     squad.UpdateLastCallTime(MyStrategy.Universe.World.TickIndex);
 }
Пример #4
0
        internal void DoRotateJerk(Queue <IMoveAction> actions)
        {
            actions.ActionSelectSquad(Id);

            IsCwDirection = !IsCwDirection;
            var angleDelta  = Math.PI / 4;
            var angleChange = IsCwDirection ? angleDelta : -angleDelta;

            actions.ActionRotateSelection(SquadCenter, angleChange);
        }
Пример #5
0
        //public double AirEnergy => (AirForce + AirDefence) / DispersionSquared;
        //public double AirEnergyRelative => AirEnergy / StartAirEnergy;
        //public double GroundEnergyRelative => GroundEnergy / StartGroundEnergy;
        //public double GroundEnergy => (GroundForce + GroundDefence) / DispersionSquared;

        //public double Energy => GroundEnergy + AirEnergy;

        #endregion

        #region Actions

        internal void DoMove(Queue <IMoveAction> actions, AbsolutePosition position)
        {
            if (NukeMarkerCounter == 0)
            {
                actions.ActionSelectSquad(Id);
                actions.ActionMoveSelectionToPosition(position);
            }
            else
            {
                MyStrategy.Universe.Print($"Squad {(Squads)Id} is locked due to Nuke marker.");
            }
            UpdateLastCallTime(MyStrategy.Universe.World.TickIndex);
        }
Пример #6
0
        public static void ActionCombineSquads(this Queue <IMoveAction> moveActions, List <Squad> squadList, Squad squadAlfa, Squad squadDelta, IdGenerator idGenerator, bool disableOld = true)
        {
            moveActions.ActionSelectSquad(squadAlfa.Id);
            moveActions.ActionAddSquadToCurrentSelection(squadDelta.Id);
            var newSquad = moveActions.ActionCreateNewSquadAlreadySelected(squadList, idGenerator);

            if (disableOld)
            {
                squadAlfa.Disable();
                squadDelta.Disable();
            }
            else
            {
                newSquad.Disable();
            }
        }
Пример #7
0
 internal void DoFollow(Queue <IMoveAction> actions, Squad thisSquad, Squad targetSquad)
 {
     actions.ActionSelectSquad(thisSquad.Id);
     actions.ActionMoveSelectionToPosition(targetSquad.SquadCenter);
     UpdateLastCallTime(MyStrategy.Universe.World.TickIndex);
 }