public void LogSelfUserAdded(NodeAddedEvent e, SingleNode <SelfUserComponent> user) { this.WriteToLog("Self user added: " + user.Entity.Id); }
public void LogUserLeftBattle(NodeRemoveEvent e, SingleNode <SelfBattleUserComponent> selfBattleUser) { this.WriteToLog("User left battle"); }
public void LogClientSessionAdded(NodeAddedEvent e, SingleNode <ClientSessionComponent> clientSession) { this.WriteToLog("Client session added: " + clientSession.Entity.Id); }
public void LogLobbyAdded(NodeAddedEvent e, SingleNode <LobbyComponent> lobby) { this.WriteToLog("Lobby added"); }
public void ClearCarouselItems(NodeRemoveEvent e, SingleNode <CarouselItemCollectionComponent> carousel) { carousel.component.Items.ForEach(item => base.DeleteEntity(item)); }
public void ClickFront(ButtonClickEvent e, SingleNode <CarouselFrontButtonComponent> btn, [JoinByCarousel] ReadyCarouselNode carousel) { this.MoveCarousel(carousel, 1); }
public void ExitBattleOnLeaveLoad(NodeRemoveEvent e, SingleNode <BattleLoadScreenComponent> battleLoadScreen, [JoinAll] NotReadySelfBattleUserNode selfBattleUser) { base.ScheduleEvent <ExitBattleEvent>(selfBattleUser); }
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)); } }
public void ShowTeamBattleSpectatorScreen(NodeAddedEvent e, ReadySpectator battleUser, [JoinByBattle] SingleNode <TeamBattleComponent> teamBattle) { base.ScheduleEvent <ShowScreenNoAnimationEvent <TeamBattleSpectatorScreenComponent> >(battleUser); }
public void ExitBattle(NodeRemoveEvent e, SingleNode <BattleScreenComponent> battleScreen, [JoinAll] SingleNode <SelfBattleUserComponent> selfBattleUser) { base.ScheduleEvent <ExitBattleEvent>(selfBattleUser); }
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(); } } } }
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); }
public void ShowGarage(NodeAddedEvent e, SingleNode <ExitBattleToLobbyLoadScreenComponent> screen, UserReadyForLobbyNode user) { base.ScheduleEvent <ShowScreenNoAnimationEvent <MainScreenComponent> >(user); base.ScheduleEvent <GoBackFromBattleScreensEvent>(screen); }
public SingleNode(T data, SingleNode <T> next = null) { Data = data; Next = next; }
public void ExitBattleOnLoading(NodeRemoveEvent e, SingleNode <SelfBattleUserComponent> selfBattleUser, [JoinAll] SingleNode <BattleLoadScreenComponent> battleLoadScreen) { base.ScheduleEvent <GoBackFromBattleEvent>(selfBattleUser); }
public void ReturnToBattle(DialogConfirmEvent e, DialogNode dialog, [JoinAll] SelfUserWithReservNode user, [JoinAll] SingleNode <ActiveScreenComponent> screen) { screen.Entity.AddComponent <LockedScreenComponent>(); base.ScheduleEvent <ReturnToBattleEvent>(user); }
public void GoBackOnKick(KickFromBattleEvent e, SelfBattleUserNode battleUser, [JoinByBattle] SingleNode <RoundComponent> round, [JoinAll] Optional <SingleNode <BattleResultsComponent> > battleResults) { if (!battleResults.IsPresent()) { base.ScheduleEvent <GoBackFromBattleEvent>(battleUser); } }
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); }
public void HideCursor(NodeAddedEvent e, SingleNode <BattleScreenComponent> battleLoadScreen, [JoinAll] UserAsTank selfBattleUserAsTank) { base.ScheduleEvent <BattleFullyLoadedEvent>(selfBattleUserAsTank); }
public void ClickBack(ButtonClickEvent e, SingleNode <CarouselBackButtonComponent> btn, [JoinByCarousel] ReadyCarouselNode carousel) { this.MoveCarousel(carousel, -1); }
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>()); }
public void InitCarouselButton(NodeAddedEvent e, SingleNode <CarouselFrontButtonComponent> button) { button.Entity.AddComponent(new CarouselGroupComponent(button.component.CarouselEntity)); }
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); }
public void LogClientSessionRemoved(NodeRemoveEvent e, SingleNode <ClientSessionComponent> clientSession) { this.WriteToLog("Client session removed: " + clientSession.Entity.Id); }
public void DeleteEmailConfirmationNotification(NodeAddedEvent e, SingleNode <EmailConfirmationNotificationComponent> notification, [JoinAll] SelfUserWithReservNode user) { base.DeleteEntity(notification.Entity); }
public void LogMapInstanceInited(NodeAddedEvent e, SingleNode <MapInstanceComponent> map) { this.WriteToLog("Battle map is inited"); }
public void OnReturnFailed(ReturnToBattleFiledEvent e, SingleNode <SelfUserComponent> user) { }
public void LogTopPanelAuthenticatedAdded(NodeAddedEvent e, SingleNode <TopPanelAuthenticatedComponent> topPanel) { this.WriteToLog("TopPanelAuthenticatedComponent added"); }
public void ReleaseReservation(DialogDeclineEvent e, SingleNode <ReturnToBattleDialogComponent> dialog, [JoinAll] SelfUserWithReservNode user) { base.ScheduleEvent <ReleaseReservationInBattleEvent>(user); }
private string GetNodeClassName(SingleNode<StringId> singleNode) { Contract.Requires(singleNode != null); return singleNode.NodeType.Name; }
public void InitTankEngineSoundEffect(NodeAddedEvent evt, [Combine] SelfTankNode tank, SingleNode <SoundListenerBattleStateComponent> soundListener) { this.InitTankEngineSoundEffect(tank, true); }