Esempio n. 1
0
        private void UpdateInventory()
        {
            List <int> AvailableInventory = new List <int>();

            for (int i = 0; i < Inventory.Count; ++i)
            {
                InvItem I = Inventory[i];
                if (I.Used)
                {
                    Inventory.RemoveAt(i);
                    CurrentInvItemAKey = InvItem.GetPrevInvAKey(Id, CurrentInvItemAKey);
                }
                else
                {
                    AvailableInventory.Add(I.ActivationKey);
                }
            }

            if (GameLevel.Input._1.Clicked && AvailableInventory.IndexOf(1) != -1)
            {
                CurrentInvItemAKey = 1;
            }
            if (GameLevel.Input._2.Clicked && AvailableInventory.IndexOf(2) != -1)
            {
                CurrentInvItemAKey = 2;
            }
            if (GameLevel.Input._3.Clicked && AvailableInventory.IndexOf(3) != -1)
            {
                CurrentInvItemAKey = 3;
            }
            if (GameLevel.Input._4.Clicked && AvailableInventory.IndexOf(4) != -1)
            {
                CurrentInvItemAKey = 4;
            }
            if (GameLevel.Input._5.Clicked && AvailableInventory.IndexOf(5) != -1)
            {
                CurrentInvItemAKey = 5;
            }
            if (GameLevel.Input._6.Clicked && AvailableInventory.IndexOf(6) != -1)
            {
                CurrentInvItemAKey = 6;
            }
            if (GameLevel.Input._7.Clicked && AvailableInventory.IndexOf(7) != -1)
            {
                CurrentInvItemAKey = 7;
            }
            if (GameLevel.Input._8.Clicked && AvailableInventory.IndexOf(8) != -1)
            {
                CurrentInvItemAKey = 8;
            }
            if (GameLevel.Input._9.Clicked && AvailableInventory.IndexOf(9) != -1)
            {
                CurrentInvItemAKey = 9;
            }
        }