Beispiel #1
0
    private void TestInv()
    {
        //Creating the items
        Debug.Log("INV SHIT HERE YEEET");
        AccessItem i  = new AccessItem("Key for dwum", 10, 1);
        AccessItem ai = new AccessItem("Key for aiaiai", 20, 3);
        BonusItem  j  = new BonusItem("Potatoe", 65, 100);
        BonusItem  bj = new BonusItem("Pota2", 10, 100);

        //Adding
        if (inventory.AddItem(i))
        {
            Debug.Log("Added " + i.GetName() + " To the inventory");
        }

        if (inventory.AddItem(ai))
        {
            Debug.Log("Added " + ai.GetName() + " To the inventory");
        }

        if (inventory.AddItem(j))
        {
            Debug.Log("Added " + j.GetName() + " To the inventory");
        }

        if (inventory.AddItem(bj))
        {
            Debug.Log("Added " + bj.GetName() + " To the inventory");
        }

        //inventory.DebugInv();

        //Can open door
        if (inventory.CanOpenDoor(1))
        {
            Debug.Log("Can open door 1");
        }
        else
        {
            Debug.Log("Can't open door 1");
        }

        if (inventory.CanOpenDoor(2))
        {
            Debug.Log("Can open door 2");
        }
        else
        {
            Debug.Log("Can't open door 2");
        }

        //Has and Remove
        if (inventory.HasItem(i))
        {
            Debug.Log("Has item " + i.GetName());
        }
        else
        {
            Debug.Log("Doesn't have " + i.GetName());
        }

        if (inventory.RemoveItem(i))
        {
            Debug.Log("Removed item");
        }
        else
        {
            Debug.Log("Couldn't remove item");
        }

        if (inventory.HasItem(i))
        {
            Debug.Log("Has item " + i.GetName());
        }
        else
        {
            Debug.Log("Doesn't have " + i.GetName());
        }
    }
Beispiel #2
0
    public void TestInventory()
    {
        Debug.Log("-=-=-=-=-=-=-=-=- TESTING INVENTORY -=-=-=-=-=-=-=-=-");
        Item i = new AccessItem(name: "small key", weight: 10, door: 1);
        Item j = new BonusItem(name: "Bathduck", weight: 50, points: 69);
        Item k = new BonusItem(name: "Triforce", weight: 50, points: 180);

        if (inventory.AddItem(i))
        {
            Debug.Log("Added " + i.GetName() + " to the inventory");
        }
        else
        {
            Debug.Log("Failed to add " + i.GetName() + " to the inventory");
        }

        if (inventory.AddItem(j))
        {
            Debug.Log("Added " + j.GetName() + " to the inventory");
        }
        else
        {
            Debug.Log("Failed to add " + j.GetName() + " to the inventory");
        }

        if (inventory.AddItem(k))
        {
            Debug.Log("Added " + k.GetName() + " to the inventory");
        }
        else
        {
            Debug.Log("Failed to add " + k.GetName() + " to the inventory");
        }

        inventory.DebugInventory();

        if (inventory.CanOpenDoor(1))
        {
            Debug.Log("Door 1 Can be opened");
        }
        else
        {
            Debug.Log("Door 1 Can not be opened");
        }

        if (inventory.CanOpenDoor(2))
        {
            Debug.Log("Door 2 Can be opened");
        }
        else
        {
            Debug.Log("Door 2 Can not be opened");
        }

        if (inventory.HasItem(i))
        {
            Debug.Log("Inventory has key");
        }
        else
        {
            Debug.Log("Inventory does not have the key");
        }

        if (inventory.RemoveItem(i))
        {
            Debug.Log("The key is removed");
        }
        else
        {
            Debug.Log("The key is not removed");
        }

        if (inventory.CanOpenDoor(1))
        {
            Debug.Log("Door 1 Can be opened");
        }
        else
        {
            Debug.Log("Door 1 Can not be opened");
        }

        if (inventory.HasItem(i))
        {
            Debug.Log("Inventory has key");
        }
        else
        {
            Debug.Log("Inventory does not have the key");
        }
    }
Beispiel #3
0
    private void TestInventoryFunctioanlity()
    {
        print("========== Testing inventory functionalities ==========");
        Item i = new AccessItem("Key of Doom", 10, 1);
        Item j = new BonusItem("Patato of the gods", 50, 50);
        Item k = new BonusItem("Globe of eternal sunshine", 50, 100);
        Item l = new PuzzelItem("Riddle01", 10, "What is an lama of islam?", "Islama");

        //added item
        if (inventory.AddItem(i))
        {
            print("Added " + i.GetName() + " to the inventory");
        }
        else
        {
            print("Failed to add " + i.GetName() + " to the inventory");
        }

        //added item
        if (inventory.AddItem(j))
        {
            print("Added " + j.GetName() + " to the inventory");
        }
        else
        {
            print("Failed to add " + j.GetName() + " to the inventory");
        }

        //added item
        if (inventory.AddItem(k))
        {
            print("Added " + k.GetName() + " to the inventory");
        }
        else
        {
            print("Failed to add " + k.GetName() + " to the inventory");
        }

        //added riddle
        if (inventory.AddItem(l))
        {
            print("Added " + l.GetName() + " to the inventory");
        }
        else
        {
            print("Failed to add " + l.GetName() + " to the inventory");
        }

        inventory.DebugInventory();

        if (inventory.CanOpenDoor(1))
        {
            print("Door 1 can be opened.");
        }
        else
        {
            print("Door 1 can NOT be opened");
        }

        if (inventory.CanOpenDoor(2))
        {
            print("Door 2 can be opened.");
        }
        else
        {
            print("Door 2 can NOT be opened");
        }

        if (inventory.HasItem(i))
        {
            print("Inventory has key of doom");
        }
        else
        {
            print("Inventory doenst have key of doom");
        }

        if (inventory.RemoveItem(i))
        {
            print("Key removed");
        }
        else
        {
            print("Key was nont removed");
        }

        if (inventory.CanOpenDoor(1))
        {
            print("Door 1 can be opened.");
        }
        else
        {
            print("Door 1 can NOT be opened");
        }

        if (inventory.HasItem(i))
        {
            print("Inventory has key of doom");
        }
        else
        {
            print("Inventory doenst have key of doom");
        }

        TestPuzzelItemFunctionallities(l);
    }
Beispiel #4
0
    private void TestInventoryFunctionality()
    {
        Debug.Log("============== Testing inventory functionality =============");
        Item i = new AccessItem("Key of doom", 10, 1);
        Item j = new BonusItem("Potato of the gods", 50, 50);
        Item k = new BonusItem("Globe of eternal sunshine", 50, 100);

        if (inventory.AddItem(i))
        {
            Debug.Log("Added " + i.GetName() + " to the inventory");
        }
        else
        {
            Debug.Log("Failed to add " + i.GetName() + " to the inventory");
        }

        if (inventory.AddItem(j))
        {
            Debug.Log("Added " + j.GetName() + " to the inventory");
        }
        else
        {
            Debug.Log("Failed to add " + j.GetName() + " to the inventory");
        }

        if (inventory.AddItem(k))
        {
            Debug.Log("Added " + k.GetName() + " to the inventory");
        }
        else
        {
            Debug.Log("Failed to add " + k.GetName() + " to the inventory");
        }

        inventory.DebugInventory();

        if (inventory.CanOpenDoor(1))
        {
            Debug.Log("Door 1 can be opened.");
        }
        else
        {
            Debug.Log("Door 1 can NOT be opened.");
        }

        if (inventory.CanOpenDoor(2))
        {
            Debug.Log("Door 2 can be opened.");
        }
        else
        {
            Debug.Log("Door 2 can NOT be opened.");
        }

        if (inventory.HasItem(i))
        {
            Debug.Log("Inventory has Key of doom");
        }
        else
        {
            Debug.Log("Key of doom not in inventory");
        }

        if (inventory.RemoveItem(i))
        {
            Debug.Log("Key Removed");
        }
        else
        {
            Debug.Log("Key was not removed");
        }

        if (inventory.CanOpenDoor(1))
        {
            Debug.Log("Door 1 can be opened.");
        }
        else
        {
            Debug.Log("Door 1 can NOT be opened.");
        }

        if (inventory.HasItem(i))
        {
            Debug.Log("Inventory has Key of doom");
        }
        else
        {
            Debug.Log("Key of doom not in inventory");
        }
    }