Exemple #1
0
    public void HideButtonPressed()
    {
        List <Room> currentRooms = houseManager.GetRoomsInUse();

        for (int i = 0; i < currentRooms.Count; i++)
        {
            //Debug.Log(currentRooms[i]);
        }
        List <Employee> currentEmployees = employeeManager.GetHiredEmployees();

        for (int i = 0; i < currentEmployees.Count; i++)
        {
            Debug.Log(currentEmployees[i]);
        }
        for (int i = 0; i < currentlySelectedRooms.Count; i++)
        {
            if (!currentRooms.Contains(currentlySelectedRooms[i]))
            {
                houseManager.AddRoom(currentlySelectedRooms[i]);
                GameManager.instance.AddRoom(currentlySelectedRooms[i]);
            }
            Debug.Log("Room Added: " + currentlySelectedRooms[i].roomName);
        }
        houseUpdatePanel.SetActive(false);
        gameUIPanel.SetActive(true);
        GameManager.instance.SetInstructionTextEnabled(false);
        GameManager.instance.SetRoomLocations();
    }
Exemple #2
0
    public void TestGetRoomsInUseWhenNoneAreInUse()
    {
        Room room1 = new Room();
        Room room2 = new Room();
        Room room3 = new Room();

        System.Collections.Generic.List <Room> rooms = new System.Collections.Generic.List <Room> {
            room1, room2, room3
        };
        HouseManager manager = new HouseManager(rooms);

        System.Collections.Generic.List <Room> roomsInUse = manager.GetRoomsInUse();

        Assert.That(roomsInUse, Has.Count.EqualTo(0));
    }
Exemple #3
0
    public void TestAddRoomNotAvailableForUse()
    {
        Room room1 = new Room();
        Room room2 = new Room();
        Room room3 = new Room();

        System.Collections.Generic.List <Room> rooms = new System.Collections.Generic.List <Room> {
            room1, room2
        };
        HouseManager manager = new HouseManager(rooms);

        Assert.Catch(delegate { manager.AddRoom(room3); });
        System.Collections.Generic.List <Room> roomsInUse = manager.GetRoomsInUse();

        Assert.That(roomsInUse, Has.Count.EqualTo(0));
    }
Exemple #4
0
    public void TestAddRoomEmptyList()
    {
        Room room1 = new Room();
        Room room2 = new Room();
        Room room3 = new Room();

        System.Collections.Generic.List <Room> rooms = new System.Collections.Generic.List <Room> {
            room1, room2, room3
        };
        HouseManager manager = new HouseManager(rooms);

        manager.AddRoom(room1);
        System.Collections.Generic.List <Room> roomsInUse = manager.GetRoomsInUse();

        Assert.That(roomsInUse, Has.Count.EqualTo(1));
    }
Exemple #5
0
    public void TestRemoveRoomEmptyList()
    {
        Room room1 = new Room();
        Room room2 = new Room();
        Room room3 = new Room();

        System.Collections.Generic.List <Room> rooms =
            new System.Collections.Generic.List <Room> {
            room1, room2, room3
        };
        HouseManager manager = new HouseManager(rooms);

        Assert.Catch(delegate { manager.RemoveRoom(room1); });
        System.Collections.Generic.List <Room> roomsInUse = manager.GetRoomsInUse();
        Assert.That(roomsInUse, Has.Count.EqualTo(0));
    }