Ejemplo n.º 1
0
        public bool CanAffordTrainerPurchase(IResourceInventory i_inventory)
        {
            int  cost     = GetNextTrainerCost();
            bool canTrain = i_inventory.HasEnoughResources(VirtualCurrencies.GOLD, cost);

            return(canTrain);
        }
Ejemplo n.º 2
0
        private IEnumerator SetGoldAction(int i_amount)
        {
            yield return(IntegrationTestUtils.SetPlayerCurrencyAndWait(i_amount));

            IResourceInventory inventory = (IResourceInventory)PlayerManager.Data;

            inventory.SetResources(VirtualCurrencies.GOLD, i_amount);
        }
Ejemplo n.º 3
0
        public bool CanUpgrade(IResourceInventory i_inventory)
        {
            if (IsAtMaxLevel())
            {
                return(false);
            }

            return(CanAffordUpgrade(i_inventory));
        }
Ejemplo n.º 4
0
 public void ChargeForUpgrade(IResourceInventory i_inventory)
 {
     foreach (KeyValuePair <string, int> cost in mData.ResourcesToUpgrade)
     {
         string resourceName   = cost.Key;
         int    resourceAmount = GetUpgradeCostForResource(resourceName);
         i_inventory.SpendResources(resourceName, resourceAmount);
     }
 }
Ejemplo n.º 5
0
        public void InitiateUpgradeWithResources(IResourceInventory i_inventory)
        {
            if (CanUpgrade(i_inventory))
            {
                ChargeForUpgrade(i_inventory);

                Upgrade();
            }
        }
Ejemplo n.º 6
0
 public void InitiateTrainerPurchase(IResourceInventory i_inventory)
 {
     if (CanAffordTrainerPurchase(i_inventory))
     {
         ChargeForTrainerPurchase(i_inventory);
         AddTrainer(NORMAL_TRAINERS, 1);
         UpdateNextTrainerCost();
         UpdateCanAffordNextTrainer();
     }
 }
Ejemplo n.º 7
0
 public bool CanAffordUpgrade(IResourceInventory i_inventory)
 {
     foreach (KeyValuePair <string, int> cost in mData.ResourcesToUpgrade)
     {
         int resourceCost = GetUpgradeCostForResource(cost.Key);
         if (i_inventory.HasEnoughResources(cost.Key, resourceCost) == false)
         {
             return(false);
         }
     }
     return(true);
 }
Ejemplo n.º 8
0
        public void ChargeForTrainerPurchase(IResourceInventory i_inventory)
        {
            int cost = GetNextTrainerCost();

            i_inventory.SpendResources(VirtualCurrencies.GOLD, cost);
        }
Ejemplo n.º 9
0
 public void InitiateUpgradeWithResources(IResourceInventory i_inventory)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 10
0
 public void ChargeForUpgrade(IResourceInventory i_inventory)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 11
0
 public bool CanUpgrade(IResourceInventory i_inventory)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 12
0
 public void Init(Building i_building, IResourceInventory i_inventory)
 {
     mBuilding  = i_building;
     mInventory = i_inventory;
 }
Ejemplo n.º 13
0
 void Start()
 {
     mTrainerManager = PlayerManager.Data.TrainerManager;
     mResources      = (IResourceInventory)PlayerManager.Data;
 }