Ejemplo n.º 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();
    }
Ejemplo n.º 2
0
    public void TestAddRoomAlreadyInUse()
    {
        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(room3);
        Assert.Catch(delegate { manager.AddRoom(room3); });
        System.Collections.Generic.List <Room> roomsInUse = manager.GetRoomsInUse();

        Assert.That(roomsInUse, Has.Count.EqualTo(1));
    }
Ejemplo n.º 3
0
    public void TestGetRoomsInUseWhenMoreThanZeroAreInUse()
    {
        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);
        manager.AddRoom(room2);
        System.Collections.Generic.List <Room> roomsInUse = manager.GetRoomsInUse();

        Assert.That(roomsInUse, Has.Count.EqualTo(2));
    }
Ejemplo n.º 4
0
    public void TestRemoveRoomListWithRoomsContained()
    {
        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);
        manager.AddRoom(room2);
        manager.RemoveRoom(room1);
        System.Collections.Generic.List <Room> roomsInUse = manager.GetRoomsInUse();

        Assert.That(roomsInUse, Has.Count.EqualTo(1));
    }