Example #1
0
 public void BuyUpgrade(int id)
 {
     if (StaticManager.GetPlayer().SpendScore(_views[id].Model.Price))
     {
         var view = _views[id];
         view.Model.Level++;
         view.Model.Price *= 1.5;
         view.Init(view.Model);
         UpdateViews();
     }
 }
Example #2
0
        public void UpdateViews()
        {
            bool   unknown = false;
            double score   = StaticManager.GetPlayer().GetScore();

            print(_views);
            foreach (UpgradeElementView view in _views)
            {
                if (unknown)
                {
                    view.SetUnknown();
                }
                else
                {
                    view.SetEnabled(score >= view.Model.Price);
                }


                if (view.Model.Level == 0)
                {
                    unknown = true;
                }
            }
        }