protected virtual void Area_OnClientEnterZoneNotify(ClientEnterZoneNotify notify) { if (!IsDelayReleaseBattleClient && current_battle != null) { current_battle.Dispose(); current_battle = null; } log.Info("ClientEnterZoneNotify : " + notify); var battle = CreateBattle(notify); battle.Layer.ActorAdded += Layer_ActorAdded; if (current_battle == null || !IsDelayReleaseBattleClient) { current_battle = battle; } else { next_battle = battle; } if (event_OnZoneChanged != null) { event_OnZoneChanged(battle); } }
public PanelBattle(GamePanelContainer container, RPGBattleClient bot) { this.container = container; this.battle = bot; base.Start(new BotBattleFactory(battle)); base.pictureBox1.MouseWheel += PictureBox1_MouseWheel; base.OnNetworkViewClicked += PanelBattle_OnNetworkViewClicked; this.OnTurboChanged += PanelBattle_OnTurboChanged; this.OnTimerBeginUpdate += PanelBattle_OnTimerBeginUpdate; }
protected virtual void Layer_ActorAdded(LayerZone layer, LayerPlayer actor) { if (next_battle != null) { if (current_battle != null) { current_battle.Dispose(); } current_battle = next_battle; next_battle = null; } if (event_OnZoneActorEntered != null) { event_OnZoneActorEntered(actor); } }
public GamePanel(GamePanelContainer container, RPGBattleClient client) { InitializeComponent(); this.mContainer = container; this.mClient = client; this.mSessionView = new FormNetSession(client.Client.GameClient); this.mSessionView.ShowInTaskbar = false; this.mSessionView.FormClosing += (object sender, FormClosingEventArgs e) => { if (this.Visible) { e.Cancel = true; mSessionView.Hide(); } }; this.Disposed += (object sender, EventArgs e) => { mSessionView.Dispose(); }; base.btn_NetView.Click += (object sender, EventArgs e) => { mSessionView.Show(); }; base.timerInfo.Tick += (object sender, EventArgs e) => { // string conn = mClient.Session.IsConnected ? "已连接" : "未连接"; // this.Text = mClient.PlayerUUID + " - [" + conn + "]"; }; base.LoadTemplates += (DirectoryInfo dataRoot) => { return(mClient.DataRoot); }; base.CreateAbstractBattle += (int sceneID) => { return(mClient); }; base.Init(); base.RenderFPS = mClient.DataRoot.Templates.CFG.SYSTEM_FPS; }
public BotBattleFactory(RPGBattleClient bot) { this.battle = bot; }