Exemplo n.º 1
0
 public bool IsSafe(string mapName, string from, RobotMove move, int movesDone, int waterproofLeft)
 {
     Map map = WellKnownMaps.LoadMap(mapName);
     return map.IsSafeMove(from, ((Vector)from).Add(move.ToVector()), movesDone, waterproofLeft);
 }
Exemplo n.º 2
0
        public Map Move(RobotMove move)
        {
            var newMap = Clone();
            if (move == RobotMove.Abort)
            {
                newMap.State = CheckResult.Abort;
                return newMap;
            }

            newMap.MovesCount++;
            if (move == RobotMove.CutBeard)
                CutBeard(newMap);
            else if (move != RobotMove.Wait)
            {
                var newRobot = Robot.Add(move.ToVector());
                if (CheckValid(newRobot.X, newRobot.Y))
                    DoMove(newRobot.X, newRobot.Y, newMap);
            }

            if (newMap.State != CheckResult.Win)
                Update(newMap);

            return newMap;
        }
Exemplo n.º 3
0
 private bool MoveChangeMapSignificantly(Map map, RobotMove move)
 {
     //			return true;
     return map.HasActiveObjects || map.RocksFallAfterMoveTo(map.Robot.Add(move.ToVector()));
 }