Пример #1
0
 public void LogSelfUserAdded(NodeAddedEvent e, SingleNode <SelfUserComponent> user)
 {
     this.WriteToLog("Self user added: " + user.Entity.Id);
 }
Пример #2
0
 public void LogUserLeftBattle(NodeRemoveEvent e, SingleNode <SelfBattleUserComponent> selfBattleUser)
 {
     this.WriteToLog("User left battle");
 }
Пример #3
0
 public void LogClientSessionAdded(NodeAddedEvent e, SingleNode <ClientSessionComponent> clientSession)
 {
     this.WriteToLog("Client session added: " + clientSession.Entity.Id);
 }
Пример #4
0
 public void LogLobbyAdded(NodeAddedEvent e, SingleNode <LobbyComponent> lobby)
 {
     this.WriteToLog("Lobby added");
 }
Пример #5
0
 public void ClearCarouselItems(NodeRemoveEvent e, SingleNode <CarouselItemCollectionComponent> carousel)
 {
     carousel.component.Items.ForEach(item => base.DeleteEntity(item));
 }
Пример #6
0
 public void ClickFront(ButtonClickEvent e, SingleNode <CarouselFrontButtonComponent> btn, [JoinByCarousel] ReadyCarouselNode carousel)
 {
     this.MoveCarousel(carousel, 1);
 }
Пример #7
0
 public void ExitBattleOnLeaveLoad(NodeRemoveEvent e, SingleNode <BattleLoadScreenComponent> battleLoadScreen, [JoinAll] NotReadySelfBattleUserNode selfBattleUser)
 {
     base.ScheduleEvent <ExitBattleEvent>(selfBattleUser);
 }
Пример #8
0
 public void ShowReturnToBattleDialog(TryShowDialog e, SelfUserWithReservNode user, [JoinAll] HomeScreenNode homeScreen, [JoinAll] SingleNode <Dialogs60Component> dialogs)
 {
     if (!Flow.Current.EntityRegistry.ContainsEntity(user.reservedInBattleInfo.Map))
     {
         base.Log.ErrorFormat("map={0} not found on reservation in battle for user={1}", user.reservedInBattleInfo.Map, user);
     }
     else if (!TutorialCanvas.Instance.IsShow)
     {
         string name = Flow.Current.EntityRegistry.GetEntity(user.reservedInBattleInfo.Map).GetComponent <DescriptionItemComponent>().Name;
         ReturnToBattleDialogComponent component  = dialogs.component.Get <ReturnToBattleDialogComponent>();
         ModalConfirmWindowComponent   component2 = component.gameObject.GetComponent <ModalConfirmWindowComponent>();
         component2.Show(homeScreen.Entity);
         component.PreformatedMainText = string.Format(component2.MainText, name, user.reservedInBattleInfo.BattleMode);
         component2.MainText           = this.InsertLeftTime(component.PreformatedMainText, (int)(user.reservedInBattleInfo.ExitTime - Date.Now));
     }
 }
Пример #9
0
 public void ShowTeamBattleSpectatorScreen(NodeAddedEvent e, ReadySpectator battleUser, [JoinByBattle] SingleNode <TeamBattleComponent> teamBattle)
 {
     base.ScheduleEvent <ShowScreenNoAnimationEvent <TeamBattleSpectatorScreenComponent> >(battleUser);
 }
Пример #10
0
 public void ExitBattle(NodeRemoveEvent e, SingleNode <BattleScreenComponent> battleScreen, [JoinAll] SingleNode <SelfBattleUserComponent> selfBattleUser)
 {
     base.ScheduleEvent <ExitBattleEvent>(selfBattleUser);
 }
Пример #11
0
        public void ShowResultTitle(NodeAddedEvent e, SingleNode <BattleResultsComponent> results, [JoinAll] SingleNode <MainHUDComponent> hud, [JoinAll] SingleNode <Dialogs60Component> dialogs)
        {
            hud.component.Hide();
            BattleResultForClient resultForClient = results.component.ResultForClient;

            if (resultForClient.PersonalResult != null)
            {
                if (resultForClient.BattleMode == BattleMode.DM)
                {
                    dialogs.component.Get <DMFinishWindow>().Show();
                }
                else
                {
                    TeamFinishWindow window = dialogs.component.Get <TeamFinishWindow>();
                    window.CustomBattle = resultForClient.Custom;
                    if (resultForClient.PersonalResult.TeamBattleResult == TeamBattleResult.DRAW)
                    {
                        window.ShowTie();
                    }
                    else if (resultForClient.PersonalResult.TeamBattleResult == TeamBattleResult.WIN)
                    {
                        window.ShowWin();
                    }
                    else
                    {
                        window.ShowLose();
                    }
                }
            }
        }
Пример #12
0
 public void ShowGoBackRequest(SpectatorGoBackRequestEvent e, Node anyNode, [JoinAll] FreeCameraNode camera, [JoinAll] SelfBattleUserNode battleUser, [JoinAll] SingleNode <Dialogs60Component> dialogs, [JoinAll] ActiveBattleScreenNode screen, [JoinAll] Optional <SingleNode <CustomBattleLobbyComponent> > customLobby)
 {
     dialogs.component.Get <ExitBattleWindow>().Show(screen.Entity, battleUser.Entity, customLobby.IsPresent(), false, false);
 }
Пример #13
0
 public void ShowGarage(NodeAddedEvent e, SingleNode <ExitBattleToLobbyLoadScreenComponent> screen, UserReadyForLobbyNode user)
 {
     base.ScheduleEvent <ShowScreenNoAnimationEvent <MainScreenComponent> >(user);
     base.ScheduleEvent <GoBackFromBattleScreensEvent>(screen);
 }
Пример #14
0
 public SingleNode(T data, SingleNode <T> next = null)
 {
     Data = data;
     Next = next;
 }
Пример #15
0
 public void ExitBattleOnLoading(NodeRemoveEvent e, SingleNode <SelfBattleUserComponent> selfBattleUser, [JoinAll] SingleNode <BattleLoadScreenComponent> battleLoadScreen)
 {
     base.ScheduleEvent <GoBackFromBattleEvent>(selfBattleUser);
 }
Пример #16
0
 public void ReturnToBattle(DialogConfirmEvent e, DialogNode dialog, [JoinAll] SelfUserWithReservNode user, [JoinAll] SingleNode <ActiveScreenComponent> screen)
 {
     screen.Entity.AddComponent <LockedScreenComponent>();
     base.ScheduleEvent <ReturnToBattleEvent>(user);
 }
Пример #17
0
 public void GoBackOnKick(KickFromBattleEvent e, SelfBattleUserNode battleUser, [JoinByBattle] SingleNode <RoundComponent> round, [JoinAll] Optional <SingleNode <BattleResultsComponent> > battleResults)
 {
     if (!battleResults.IsPresent())
     {
         base.ScheduleEvent <GoBackFromBattleEvent>(battleUser);
     }
 }
Пример #18
0
 public void TryResumeTutorialOnReleaseReservation(ReleaseReservationInBattleEvent e, SelfUserWithReservNode user, [JoinAll, Combine] SingleNode <TutorialShowTriggerComponent> tutorialTrigger)
 {
     if (user.Entity.HasComponent <TurnOffTutorialUserComponent>())
     {
         user.Entity.RemoveComponent <TurnOffTutorialUserComponent>();
     }
     base.NewEvent <TryResumeTutorialEvent>().Attach(user).ScheduleDelayed(0.05f);
 }
Пример #19
0
 public void HideCursor(NodeAddedEvent e, SingleNode <BattleScreenComponent> battleLoadScreen, [JoinAll] UserAsTank selfBattleUserAsTank)
 {
     base.ScheduleEvent <BattleFullyLoadedEvent>(selfBattleUserAsTank);
 }
Пример #20
0
 public void ClickBack(ButtonClickEvent e, SingleNode <CarouselBackButtonComponent> btn, [JoinByCarousel] ReadyCarouselNode carousel)
 {
     this.MoveCarousel(carousel, -1);
 }
Пример #21
0
        public void OnRequestGoBack(RequestGoBackFromBattleEvent e, Node any, [JoinAll] SingleNode <Dialogs60Component> dialogs, [JoinAll] ActiveBattleScreenNode screen, [JoinAll] SelfBattleNonSpectatorNode battleUser, [JoinByBattle] SingleNode <RoundActiveStateComponent> activeRound, [JoinByBattle] BattleNode battle, [JoinByBattle] ICollection <BattleUserAsTankNode> battleUsers, [JoinAll] Optional <SingleNode <CustomBattleLobbyComponent> > customLobby, [JoinAll] Optional <SingleNode <ChosenMatchMackingModeComponent> > chosenMode)
        {
            bool isDeserter = this.IsDeserter(battle, battleUser, battleUsers);

            dialogs.component.Get <ExitBattleWindow>().Show(screen.Entity, battleUser.Entity, customLobby.IsPresent(), isDeserter, chosenMode.IsPresent() && chosenMode.Get().component.ModeEntity.HasComponent <MatchMakingDefaultModeComponent>());
        }
Пример #22
0
 public void InitCarouselButton(NodeAddedEvent e, SingleNode <CarouselFrontButtonComponent> button)
 {
     button.Entity.AddComponent(new CarouselGroupComponent(button.component.CarouselEntity));
 }
Пример #23
0
    public bool SaveData(string fileName)
    {
        if (m_nodes == null || m_nodes.Count <= 0)
        {
            return(false);
        }

        string reta = "ID,名字,Body类型,创建类型,位置,X大小(BOX),Y大小(BOX),半径,vertices点,Edge起点,Edge终点,IsBreakable,Break物体主物体名,过滤类型,默认是否激活,是否传感器,Senesor速度参数,是否单向通行,单项通行方向,Sensor是否固定,Sensor外加力方向";

        reta += "\r\n";
        reta += "ID,NAME,BODYTYPE,CREATETYPE,COLLISIONID,POSITION,SIZEX,SIZEY,RADIUS,VERTICES,STARTPOS,ENDPOS,ISBREAKABLE,BREAKMAINNAME,FILTERTYPE,ISACTIVE,ISSENSOR,SPEEDRATIO,ISONEWAY,ONEWAYDIR,ISSTUCKDIR,FORCEDOR";
        reta += "\r\n";

        for (int i = 0; i < m_nodes.Count; i++)
        {
            SingleNode nd = m_nodes[i];
            if (nd != null)
            {
                reta += i.ToString();
                reta += ",";
                reta += "Collider_" + i.ToString();
                reta += ",";
                reta += "0";
                reta += ",";
                reta += ((int)nd.type).ToString();
                reta += ",";
                reta += "0";
                reta += ",";
                reta += nd.position.x + ";" + nd.position.y;
                reta += ",";
                reta += nd.sizeX.ToString();
                reta += ",";
                reta += nd.sizeY.ToString();
                reta += ",";
                reta += nd.radius.ToString();
                reta += ",";
                if (nd.vertices != null)
                {
                    for (int j = 0; j < nd.vertices.Count; j++)
                    {
                        Vector2 vertice = nd.vertices[j];
                        reta += vertice.x + ";" + vertice.y;
                        if (j != nd.vertices.Count - 1)
                        {
                            reta += "=";
                        }
                    }
                }
                reta += ",";
                reta += nd.startPos.x + ";" + nd.startPos.y;
                reta += ",";
                reta += nd.endPos.x + ";" + nd.endPos.y;
                reta += ",";
                reta += "FALSE";
                reta += ",";
                reta += "0";
                reta += ",";
                reta += "0";
                reta += ",";
                reta += "TRUE";
                reta += ",";
                reta += nd.isSensor;
                reta += ",";
                if (nd.sensorNode != null)
                {
                    reta += nd.sensorNode.SpeedRatio;
                    reta += ",";
                    reta += nd.sensorNode.IsOneWay;
                    reta += ",";
                    reta += nd.sensorNode.OneWayDir.x + ";" + nd.sensorNode.OneWayDir.y;
                    reta += ",";
                    reta += nd.sensorNode.IsStuckDir;
                    reta += ",";
                    reta += nd.sensorNode.ForceDir.x + ";" + nd.sensorNode.ForceDir.y;
                }
                else
                {
                    reta += ",";
                    reta += ",";
                    reta += ",";
                    reta += ",";
                }
                reta += "\r\n";
            }
        }
        string filePath = GlobalVarFun.m_streamAssets + "Map/" + fileName + ".csv";

        GlobalVarFun.SaveStringToFile(reta, filePath);

        return(true);
    }
Пример #24
0
 public void LogClientSessionRemoved(NodeRemoveEvent e, SingleNode <ClientSessionComponent> clientSession)
 {
     this.WriteToLog("Client session removed: " + clientSession.Entity.Id);
 }
Пример #25
0
 public void DeleteEmailConfirmationNotification(NodeAddedEvent e, SingleNode <EmailConfirmationNotificationComponent> notification, [JoinAll] SelfUserWithReservNode user)
 {
     base.DeleteEntity(notification.Entity);
 }
Пример #26
0
 public void LogMapInstanceInited(NodeAddedEvent e, SingleNode <MapInstanceComponent> map)
 {
     this.WriteToLog("Battle map is inited");
 }
Пример #27
0
 public void OnReturnFailed(ReturnToBattleFiledEvent e, SingleNode <SelfUserComponent> user)
 {
 }
Пример #28
0
 public void LogTopPanelAuthenticatedAdded(NodeAddedEvent e, SingleNode <TopPanelAuthenticatedComponent> topPanel)
 {
     this.WriteToLog("TopPanelAuthenticatedComponent added");
 }
Пример #29
0
 public void ReleaseReservation(DialogDeclineEvent e, SingleNode <ReturnToBattleDialogComponent> dialog, [JoinAll] SelfUserWithReservNode user)
 {
     base.ScheduleEvent <ReleaseReservationInBattleEvent>(user);
 }
Пример #30
0
        private string GetNodeClassName(SingleNode<StringId> singleNode)
        {
            Contract.Requires(singleNode != null);

            return singleNode.NodeType.Name;
        }
Пример #31
0
 public void InitTankEngineSoundEffect(NodeAddedEvent evt, [Combine] SelfTankNode tank, SingleNode <SoundListenerBattleStateComponent> soundListener)
 {
     this.InitTankEngineSoundEffect(tank, true);
 }