Beispiel #1
0
    void initDailyGiftCountdown(PPTuning tuning, PPDataController dataController)
    {
        float dailyGiftCountdown;
        bool  redeemOnTimerReset = false;

        if (dataController.DailyGiftCountdownRunning && !overrideTimerForDebugging)
        {
            dailyGiftCountdown = dataController.DailyGiftCountdown;
        }
        else
        {
            dailyGiftCountdown = tuning.WaitTimeSecsForDailyGift;
            redeemOnTimerReset = true;
        }
        dailyGiftTimer = new PPTimer(dailyGiftCountdown, tuning.DefaultTimerTimeStepSec);
        giftTimerDisplay.SetText(dailyGiftTimer.TimeRemainingStr);
        if (dataController.HasGiftToRedeem || redeemOnTimerReset)
        {
            makeDailyGiftAvailableToRedeem();
        }
        else
        {
            startGiftTimer();
        }
    }
Beispiel #2
0
 public void Initialize(PPDataController dataController)
 {
     this.dataController = dataController;
     if (!IsInitialized)
     {
         this.Initialize();
     }
 }
Beispiel #3
0
 public void Init(CurrencyData currency, PPDataController dataController)
 {
     this.dataController = dataController;
     unsubscribeEvents();
     type = currency.Type;
     setIcon(currency);
     updateAmount(currency.Amount);
     this.dataController.SubscribeToCurrencyChange(type, updateAmount);
 }
    void setupScoutingOnLoad(PPDataController dataController)
    {
        List <DogDescriptor> dogs = dataController.ScoutingDogs;

        if (dogs != null && dogs.Count > 0)
        {
            Dog[] dogObjs = new DogFactory(hideGameObjects: true).CreateGroup(dogs.ToArray());
            callScoutingDogsLoaded(dogObjs);
        }
    }
Beispiel #5
0
    public void Init(PPGameController gameController, PPDataController dataController, PPGiftController giftController)
    {
        unsubscribeEvents();
        this.giftController = giftController;
        this.dataController = dataController;
        subscribeEvents();

        // Display Updated Currency
        coinsDisplay.Init(dataController.Coins, dataController);
        initDailyGiftCountdown(gameController.Tuning, dataController);
    }
 bool checkToAddStartingDogs(PPDataController dataController)
 {
     if (shouldAddStartingDogs(dataController))
     {
         for (int i = 0; i < tuning.StartingDogCount; i++)
         {
             dataController.Adopt(dogDatabase.RandomDog(mustBeUnadopted: true));
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #7
0
 protected virtual void fetchReferences()
 {
     this.referencesFetched = true;
     // Check if it has already been initialized, some classes may prefer to use a custom data controller
     if (!this.dataController)
     {
         this.dataController = PPDataController.GetInstance;
     }
     if (!this.gameController)
     {
         this.gameController = PPGameController.GetInstance;
     }
     if (!this.analytics)
     {
         this.analytics = AnalyticsController.Instance;
     }
 }
 bool shouldAddStartingDogs(PPDataController dataController)
 {
     return(dataController.ShouldGiveFreeDogs);
 }
 void handleLoadGame(PPDataController dataController)
 {
     checkToAddStartingDogs(dataController);
     setupScoutingOnLoad(dataController);
 }
Beispiel #10
0
 static object[] getPropertyValues(PPDataController data)
 {
     return(new object[] { string.Format("{0} {1}", Time.time, k.SECONDS), data.TimesDogFoodRefilled });
 }
Beispiel #11
0
 public PlaySessionEvent(PPDataController data) :
     base(PLAY_SESSION, getPropertyKeys(), getPropertyValues(data))
 {
     // NOTHING
 }