Britbot
static void Britbot.Mover.MoveAll ( Dictionary< Pirate, Direction >  moves) [inline, static]

Moves pirate according to the moves dictionary it got.

Parameters:
movesA dictionary of consists of entries that have a pirate and a corresponding direction to move at

Definition at line 19 of file Mover.cs.

        {
            //Logger.BeginTime("MoveAll");
            try
            {
                //iterate over all moves and execute them
                foreach (KeyValuePair<Pirate, Direction> move in moves)
                {
                    if (!move.Key.IsLost)
                        Bot.Game.SetSail(move.Key, move.Value);
                }
            }
            catch
            {
                //don't move anything if we crash, but this will save us from timeout
                foreach (Pirate p in Bot.Game.AllMyPirates())
                {
                    if (!p.IsLost)
                        Bot.Game.SetSail(p, Direction.NOTHING);
                }
            }
            //Logger.StopTime("MoveAll");
        }