public static void LockerRoomTest(String[] args)
        {
            LockerRoom <String> stringLockers = new LockerRoom <String>();

            stringLockers.Add(1, new Locker <String>("junk"));
            stringLockers.Add(3, new Locker <String>("towel"));
            stringLockers.Add(4, new Locker <String>("goggles"));
            stringLockers.Add(190, new Locker <String>("snorkle"));
            Locker <String> locker = stringLockers.Find(3);

            Console.WriteLine(locker.GetContents());
            // Vi borde fått ut "towel" i terminalen
            if (stringLockers.HasThing("goggles"))
            {
                Console.WriteLine("We found goggles in a locker!");
                // borde komma ut
            }
            if (stringLockers.HasThing("sandwich"))
            {
                Console.WriteLine("We found a sandwich, ugh!");
                // borde INTE komma ut
            }
            ListOfObjects <string> list = new ListOfObjects <string>();

            list.AddObject("Forty-two");
        }
Example #2
0
    private bool runningTimer = false; //bool to run timer

    void Start()
    {
        objObjectList   = GameObject.Find("ObjectLists");
        objectList      = objObjectList.GetComponent <ListOfObjects>();
        StockpileScript = StockpileObj.GetComponent <Stockpile>();
        thisUnit        = gameObject.GetComponent <UnitV2>();
    }
        public void ShouldFindEconomicsAtIndex0()
        {
            ListOfObjects <String> L = new ListOfObjects <String>();

            L.Populate(101, "Economics", "How money flows around in an economy.");
            L.Populate(202, "Biology", "Machinery inside animals that keeps them alive.");
            L.Populate(303, "Mathematics", "Numbers working with other numbers to make more numbers.");
            L.Populate(404, "Free lecture", "Everyone's favourite, for obvious reasons.");
            L.Populate(505, "Art", "Throwing colours around and pretending to be an artist.");
            Assert.AreEqual(L.Search("Economics"), 0);
        }
Example #4
0
        static void Main(string[] args)
        {
            ListOfObjects <object> myListOfObjects = new ListOfObjects <object>();

            myListOfObjects.AddObject(42);
            myListOfObjects.AddObject("Mr.Fantastic");
            myListOfObjects.AddObject(true);
            myListOfObjects.AddObject(47.11);
            myListOfObjects.AddObject("test5");
            myListOfObjects.AddObject("test6");
            myListOfObjects.AddObject("test7");
            myListOfObjects.AddObject("test8");
            myListOfObjects.AddObject("test9");
            myListOfObjects.AddObject("test10");
            myListOfObjects.AddObject("test11");
            Console.WriteLine(myListOfObjects.GetObject(3));
            Console.WriteLine(myListOfObjects.GetObject(10));
            Console.WriteLine(myListOfObjects.GetObject(5));
            Console.WriteLine(myListOfObjects.GetObject(11));
            Console.ReadKey();
        }
Example #5
0
 public void SetCurrentInventoryObject(int id)
 {
     CurrentInventoryObject = ListOfObjects.Find(x => x.Id == id);
 }
Example #6
0
    void JimManaFlow()
    {
        ListOfObjects objList = GameObject.Find("ObjectLists").GetComponent <ListOfObjects>();

        mana += (objList.jimList.Length * 0.25f);
    }