Exemple #1
0
 public void Execute()
 {
     if (hasNewValue)
     {
         lobbyUiContext.ReplaceUsername(accountData.Username);
         lobbyUiContext.ReplaceAccountRating(accountData.AccountRating);
         lobbyUiContext.ReplaceHardCurrency(accountData.HardCurrency);
         lobbyUiContext.ReplaceSoftCurrency(accountData.SoftCurrency);
         WarshipTypeEnum warshipTypeEnum = CurrentWarshipTypeStorage.ReadWarshipType();
         lobbyUiContext.ReplaceCurrentWarshipTypeEnum(warshipTypeEnum);
         lobbyUiContext.ReplacePointsForSmallLootbox(accountData.SmallLootboxPoints);
         CreateWarshipComponents(accountData.Warships, lobbyUiContext);
         hasNewValue = false;
     }
 }
Exemple #2
0
        public void Execute()
        {
            DateTime now = DateTime.Now;

            LobbyUiEntity[] awards = movingAwardsGroup.GetEntities();
            for (int index = 0; index < awards.Length; index++)
            {
                LobbyUiEntity movingAward = awards[index];
                DateTime      arrivalTime = movingAward.movingIcon.iconTrajectory.controlPoints.Last().arrivalTime;
                if (arrivalTime <= now)
                {
                    int increment = movingAward.movingIcon.increment;
                    switch (movingAward.movingIcon.awardTypeEnum)
                    {
                    case AwardTypeEnum.SoftCurrency:
                        uiSoundsManager.PlaySoftAdding();
                        lobbyUiContext.ReplaceSoftCurrency(lobbyUiContext.softCurrency.value + increment);
                        break;

                    case AwardTypeEnum.AccountRating:
                        uiSoundsManager.PlayRatingAdding();
                        lobbyUiContext.ReplaceAccountRating(lobbyUiContext.accountRating.value + increment);
                        break;

                    case AwardTypeEnum.HardCurrency:
                        uiSoundsManager.PlayHardAdding();
                        lobbyUiContext.ReplaceHardCurrency(lobbyUiContext.hardCurrency.value + increment);
                        break;

                    case AwardTypeEnum.LootboxPoints:
                        uiSoundsManager.PlayPointsAdding();
                        lobbyUiContext.ReplacePointsForSmallLootbox(lobbyUiContext.pointsForSmallLootbox.value + increment);
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }

                    Object.Destroy(movingAward.view.gameObject);
                    movingAward.Destroy();
                }
            }
        }