예제 #1
0
        private void UpdateEnergyCell(UserInSquadNode user, [JoinByUser] UserEnergyCellNode userCell, [JoinByUser] EnergyItemNode energy, [JoinByLeague] LeagueNode league)
        {
            UserGiftEnergyEvent eventInstance = new UserGiftEnergyEvent();

            base.ScheduleEvent(eventInstance, user);
            userCell.userEnergyCellUi.Setup(user.userUid.Uid, energy.userItemCounter.Count + eventInstance.totalGift, league.leagueEnergyConfig.Cost);
            userCell.userEnergyCellUi.SetGiftValue(eventInstance.totalGift, eventInstance.uids);
        }
예제 #2
0
        public void InitUser(NodeAddedEvent e, UserEnergyCellNode userEnergyCell, [JoinByUser] UserInSquadNode user, [JoinByLeague] LeagueNode league, UserEnergyCellNode userEnergyCell1, [JoinByUser] Optional <EnergyItemNode> energy)
        {
            UserGiftEnergyEvent eventInstance = new UserGiftEnergyEvent();

            base.ScheduleEvent(eventInstance, user);
            userEnergyCell.userEnergyCellUi.Setup(user.userUid.Uid, !energy.IsPresent() ? 0L : (energy.Get().userItemCounter.Count + eventInstance.totalGift), league.leagueEnergyConfig.Cost);
            userEnergyCell.userEnergyCellUi.SetGiftValue(eventInstance.totalGift, eventInstance.uids);
        }
예제 #3
0
 public void EnergyAdded(NodeAddedEvent e, EnergyItemNode energy, [JoinByUser] UserInSquadNode user, [JoinByUser] UserEnergyCellNode userCell, [JoinByUser] UserInSquadNode userInSquad, [JoinByLeague] LeagueNode league)
 {
     this.UpdateEnergyCell(user, userCell, energy, league);
     this.UpdateSquadTeleportInfo(user);
 }
예제 #4
0
 public void UpdateEnergyCells(SquadEnergyChangedEvent e, SquadNode squad, [JoinBySquad] SelfUserInSquadNode selfUserInSquad, [JoinBySquad, Combine] UserInSquadNode user, [JoinByUser] UserEnergyCellNode userCell, [JoinByUser] EnergyItemNode energy, [JoinByUser] UserInSquadNode userInSquad, [JoinByLeague] LeagueNode league)
 {
     this.UpdateEnergyCell(user, userCell, energy, league);
 }
예제 #5
0
 public void ShareEnergy(ButtonClickEvent e, SingleNode <ShareEnergyButtonComponent> button, [JoinByUser] UserInSquadNode userInSquad, [JoinByUser] UserEnergyCellNode userCell, [JoinAll] SelfUserInSquadNode selfUserInSquad, [JoinAll] SingleNode <Dialogs60Component> dialogs)
 {
     userCell.userEnergyCellUi.HideShareButton();
     if (!userCell.userEnergyCellUi.Buy)
     {
         ShareEnergyEvent eventInstance = new ShareEnergyEvent {
             ReceiverId = userInSquad.Entity.Id
         };
         base.ScheduleEvent(eventInstance, selfUserInSquad);
     }
     else
     {
         EnergyPriceEvent eventInstance = new EnergyPriceEvent {
             count = userCell.userEnergyCellUi.ShareEnergyValue
         };
         base.ScheduleEvent(eventInstance, userInSquad);
         dialogs.component.Get <BuyEnergyDialogComponent>().Show(eventInstance.count, eventInstance.price);
     }
 }