Esempio n. 1
0
        private Dictionary <PodRacer, PodRacerCommand> GetRacerCommandsFromPilots()
        {
            Dictionary <PodRacer, PodRacerCommand> commands;

            commands = new Dictionary <PodRacer, PodRacerCommand>();

            foreach (var podRacer in podRacers)
            {
                PodRacerCommand command = null;

                if (!raceState.PodRacerRaceStates[podRacer].Failed)
                {
                    try
                    {
                        command = podRacer.Pilot.EvaluateCommand(race);
                    }
                    catch
                    {
                        raceState.PodRacerRaceStates[podRacer].Failed = true;
                    }
                }

                raceResult.CommandsForPodRacers[podRacer].Add(command);
                commands.Add(podRacer, command);
            }

            return(commands);
        }
        public PodRacerCommand Copy()
        {
            PodRacerCommand copy;

            copy = new PodRacerCommand();

            copy.Destination = new Vector(Destination);
            copy.Thrust      = Thrust;
            copy.Shield      = Shield;
            copy.Boost       = Boost;

            return(copy);
        }