Example #1
0
        public string DeleteIndividualRobot(int index)
        {
            var targetRobot = RobotList.Find(x => x.Index == index);

            if (targetRobot == null)
            {
                return("해당 로봇이 없습니다.");
            }

            RobotList.Remove(targetRobot);
            return($"ID {index}번 로봇을 삭제하였습니다.");
        }
Example #2
0
        public string MoveIndividualRobot(int index, int direction)
        {
            var targetRobot = RobotList.Find(x => x.Index == index);

            if (targetRobot == null)
            {
                return("해당 로봇이 없습니다.");
            }
            var locationValues = targetRobot.Move(direction, RoomWidthSize, RoomVerticalSize);

            return($"{targetRobot.GetType()} 타입의 {targetRobot.Model}가 {locationValues[0]} {locationValues[1]} 위치에서 {locationValues[2]} {locationValues[3]} 로 이동하였습니다.");
        }