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); }
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; }
private bool MoveChangeMapSignificantly(Map map, RobotMove move) { // return true; return map.HasActiveObjects || map.RocksFallAfterMoveTo(map.Robot.Add(move.ToVector())); }