Esempio n. 1
0
 public Inventory() : base("playerInventory", EventId.InventoryResourceUpdated, null)
 {
     this.Troop         = base.CreateSubstorage("troop", EventId.InventoryTroopUpdated, typeof(TroopTypeVO));
     this.SpecialAttack = base.CreateSubstorage("specialAttack", EventId.InventorySpecialAttackUpdated, typeof(SpecialAttackTypeVO));
     this.Hero          = base.CreateSubstorage("hero", EventId.InventoryHeroUpdated, typeof(TroopTypeVO));
     this.Champion      = base.CreateSubstorage("champion", EventId.InventoryChampionUpdated, typeof(TroopTypeVO));
 }
Esempio n. 2
0
        public InventoryStorage CreateSubstorage(string key, EventId updateEvent, Type inventoryType)
        {
            InventoryStorage inventoryStorage = new InventoryStorage(key, updateEvent, inventoryType);

            this.subStorage.Add(key, inventoryStorage);
            return(inventoryStorage);
        }
Esempio n. 3
0
        public bool IsInventorySubstorageFull()
        {
            if (this.totalStorageCapacity == -1)
            {
                return(false);
            }
            int num = 0;

            foreach (string current in this.subStorage.Keys)
            {
                InventoryStorage inventoryStorage = this.subStorage[current];
                num += inventoryStorage.GetTotalStorageAmount();
            }
            return(num >= this.totalStorageCapacity);
        }