Exemple #1
0
        private void AssignButtons()
        {
            _uiButtons.BuyPlotButton.onClick.AddListener(() =>
            {
                _game.BuyPlot(_plotId);
            });

            _uiButtons.ExtendPlotButton.onClick.AddListener(() =>
            {
                bool success = _game.ExtendPlot(_plotId);
                if (success)
                {
                    Micros.GetAudioMicro().Play(ClipName.BuyClip);
                }
            });

            _uiButtons.ExtendWarehouseButton.onClick.AddListener(() =>
            {
                bool success = _game.ExtendWarehouse(_plotId);
                if (success)
                {
                    Micros.GetAudioMicro().Play(ClipName.BuyClip);
                }
            });

            _uiButtons.SellButton.onClick.AddListener(() =>
            {
                _game.Sell(_plotId);
                Micros.GetAudioMicro().Play(ClipName.SellClip);
            });
        }
Exemple #2
0
        public Garden()
        {
            _saveMicro = Micros.GetSaveMicro();
            _saveMicro.AddCoins(InitialData.InitialCoins);

            _plots = InitialData.GetPlotsData();
            _saveMicro.SetPlots(_plots);
        }
Exemple #3
0
        private void Start()
        {
            Micros.Init();
            _saveMicro = Micros.GetSaveMicro();

            if (_saveMicro.LoadedSaveGame)
            {
                //There is a saved game, let's get it
                _garden = new Garden(_saveMicro.GetPlots());
            }
            else
            {
                //Nope, let's create some data
                //Garden will take care of this
                _garden = new Garden();
            }

            InitializePlotViews();
            MainUi.UpdateView();
        }
Exemple #4
0
        public void UpdateView()
        {
            double numCoins = Micros.GetSaveMicro().GetCoins();

            CoinText.text = "Coins: " + S.CoinStr(numCoins);
        }
Exemple #5
0
        async void Micros_Refreshing(object sender, EventArgs e)
        {
            await RefreshMicros();

            Micros.EndRefresh();
        }
Exemple #6
0
 private void OnApplicationQuit()
 {
     Micros.GetSaveMicro().Save();
 }
Exemple #7
0
 public Garden(List <Plot> plots)
 {
     _saveMicro = Micros.GetSaveMicro();
     _plots     = plots;
 }
Exemple #8
0
 public Nutrients(Macros macros, Micros micros)
 {
     Macros = macros;
     Micros = micros;
 }