/// <summary> /// Room map /// </summary> public RoombaRobotController( IRoomMap roomMap, ICleaningRobot robot, ICleaningRobotStrategy givenStrategy, ICleaningRobotStrategy backOffStrategy) { _map = roomMap; _robot = robot; _givenStrategy = givenStrategy; _backOffStrategy = backOffStrategy; }
public void Setup() { _mapSerializer = new RoomMapJsonSerializer(); _map = new RoombaMap(_mapSerializer); _robotSerializer = new CleaningRobotJsonSerializer(); _robot = new RoombaRobot(_map, _robotSerializer); _strategySerializer = new CleaningRobotStrategyJsonSerializer(); _trCommand = new CleaningRobotTurnRightCommand(_robot); _tlCommand = new CleaningRobotTurnLeftCommand(_robot); _aCommand = new CleaningRobotAdvanceCommand(_robot); _bCommand = new CleaningRobotBackCommand(_robot); _cCommand = new CleaningRobotCleanCommand(_robot); _givenStrategy = new CleaningRobotResumableStrategy(_tlCommand, _trCommand, _aCommand, _cCommand, _strategySerializer); _backOffStrategy = new CleaningRobotBackOffStrategy(_tlCommand, _trCommand, _aCommand, _bCommand, _cCommand); _robotController = new RoombaRobotController(_map, _robot, _givenStrategy, _backOffStrategy); }