示例#1
0
 public void OnOfferPurchased()
 {
     offerState = SpecialOfferState.Completed;
     Player.AddPlayerCash(new CurrencyNumber(PlayerCashReward));
     Player.AddCompanyCash(ComplanyCashReward);
     Player.AddCoins(CoinsReward);
 }
示例#2
0
        private void UpdateOfferState()
        {
            if (IsLoaded && GameMode.IsGame)
            {
                switch (offerState)
                {
                case SpecialOfferState.NotStarted: {
                    if (Planets.CurrentPlanetId.Id != PlanetConst.EARTH_ID)
                    {
                        if (PlanetStartInterval > FiveMinutes)
                        {
                            StartOffer();
                        }
                    }
                }
                break;

                case SpecialOfferState.Started: {
                    if (IsExpired)
                    {
                        offerState = SpecialOfferState.Expired;
                    }
                }
                break;

                case SpecialOfferState.Expired: {
                }
                break;

                case SpecialOfferState.Completed: {
                }
                break;
                }
            }
        }
示例#3
0
 private void OnPlanetStateChanged(PlanetState oldState, PlanetState newState, PlanetInfo planet)
 {
     if (IsLoaded)
     {
         if (newState == PlanetState.Opened && planet.Id != PlanetConst.EARTH_ID)
         {
             planetStartTime = Services.TimeService.UnixTimeInt;
             offerState      = SpecialOfferState.NotStarted;
         }
     }
 }
示例#4
0
        public override void LoadSave(object obj)
        {
            SpecialOfferServiceSave save = obj as SpecialOfferServiceSave;

            if (save != null)
            {
                expireTime      = save.expireTime;
                planetStartTime = save.planetStartTime;
                offerState      = save.offerState;
                IsLoaded        = true;
            }
            else
            {
                LoadDefaults();
            }
        }
示例#5
0
 public override void LoadDefaults()
 {
     StartCoroutine(LoadDefaultPlanetStartTime());
     offerState = SpecialOfferState.NotStarted;
     IsLoaded   = true;
 }
示例#6
0
 private void StartOffer()
 {
     offerState = SpecialOfferState.Started;
     expireTime = Services.TimeService.UnixTimeInt + 600;
     StartCoroutine(ShowOfferViewImpl());
 }