void feedDogs(DogFoodData food) { int amountFoodNeeded = calculateDogFoodNeeded(); if (amountFoodNeeded <= k.NONE_VALUE) { return; } DogFoodData foodNeeded = food.Copy(); foodNeeded.SetAmount(-amountFoodNeeded); if (dataController.HasFood(food.FoodType, amountFoodNeeded) && !IsCurrentlyFeeding) { dataController.ChangeCurrencyAmount(foodNeeded); buttonReference.interactable = false; EventController.Event(k.GetPlayEvent(k.ADD_FOOD)); dataController.RefillDogFood(); giveDogsFood(foodNeeded); foodBowlImage.color = food.Color; currentFood = foodNeeded; feedingTimer.Reset(); feedingTimer.Begin(); foodSelector.Hide(); } else { EventController.Event(k.GetPlayEvent(k.EMPTY)); foodSelector.SetDescription(LanguageDatabase.GetInstance.GetTerm(k.BUY_MORE_FOOD)); foodSelector.SetDelegate(loadFoodShop); } }
public bool TrySendToScout() { if (!IsScouting && HasScoutingTimer) { descriptor.HandleScoutingBegan(gameController.GetCurrentSlotIndex()); scoutingTimer.Begin(); int slotIndex; bool wasSuccess = gameController.TrySendDogToScout(this, out slotIndex); if (wasSuccess) { analytics.SendEvent( new DogAnalyticsEvent( DogAnalyticsEvent.DOG_SEND_TO_SCOUT, this.descriptor)); } else { descriptor.HandleScoutingEnded(); } return(wasSuccess); } else { return(false); } }
void resetAndBeginGiftTimer() { collectGiftButton.ToggleInteractable(false); collectGiftButton.TryUnsubscribeAll(); (dailyGiftTimer as ISubscribable).TryUnsubscribeAll(); dailyGiftTimer.SubscribeToTimeChange(handleDailyGiftCountDownChange); dailyGiftTimer.SubscribeToTimeUp(makeDailyGiftAvailableToRedeem); dataController.StartDailyGiftCountdown(dailyGiftTimer); dailyGiftTimer.Begin(); }
public void BeginTimer() { timer.Begin(); }