コード例 #1
0
    public void Switch(string roomName)
    {
        Modul currentRoom = SearchRoom(roomName);

        if (currentRoom.RoomName == roomName)
        {
            if (currentRoom.RoomPower)
            {
                currentRoom.TurnOffPower();
                _reactor.TurnOffRoom();
            }
            else
            {
                if (_reactor.CheckCountPower())
                {
                    currentRoom.TurnOnPower();
                    _reactor.TurnOnRoom();
                }
            }
        }
    }