private void CallCommandObservers(FleetCommand previousCommand, FleetCommand newCommand)
 {
     foreach (Action <FleetCommand, FleetCommand> action in commandObservers)
     {
         action.Invoke(previousCommand, newCommand);
     }
 }
        public FleetCommand SetNextFleetCommand()
        {
            FleetCommand fleetCommand = GetNextFleetCommand();

            CurrentFleetCommand = fleetCommand;

            if (!loopFleetCommands)
            {
                fleetCommands.RemoveAt(0);
            }

            return(fleetCommand);
        }
        public ISerializable <FleetCommandQueuePersistance> SetObject(FleetCommandQueuePersistance serializedObject)
        {
            this.loopFleetCommands = serializedObject.loopFleetCommands;
            foreach (FleetCommandPersistance fleetCommandPersistance in serializedObject.fleetCommands)
            {
                fleetCommands.Add(fleetCommandPersistance.ToFleetCommand());
            }
            if (fleetCommands.Count > 0)
            {
                currentFleetCommand = fleetCommands[serializedObject.currentFleetCommand];
            }

            return(this);
        }
 public void ResetCommands()
 {
     fleetCommands.Clear();
     CurrentFleetCommand = null;
 }