//Crea el robot y lo ubica aleatoriamente en una casilla del ambiente private void SetRobot(HomeRobot robot) { Point pos; while (Robot == null) { pos = RandomPos(); if (!InPlaypen(pos) && (this[pos].CurrentStatus == CellStatus.Empty || this[pos].CurrentStatus == CellStatus.Dirt) && AdjacentCells(pos, x => !this[x].IsObstacled() && !this[x].IsPlaypen()).Count > 0) { Robot = robot; Robot.Reset(pos); this[pos].SetMobileObject(CellStatus.Robot, Robot); } } }
public Simulation(Environment env, HomeRobot bot) { environment = env; robot = bot; }