using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using CommonAIClient.Client; using RoomService.Net.BsServer; using RoomService.Net.BsClient; using GameEditorPlugin.Win32.Runtime; using CommonLang.Protocol; using CommonAI.ZoneClient; using CommonLang; using CommonAI.RTS; using CommonLang.Vector; using CommonAI.Zone; using CommonAI.Zone.ZoneEditor; using CommonLang.Log; using GameEditorPlugin.Win32.BattleClient; using System.IO; using CommonLang.IO; using CommonLang.ByteOrder; using CommonLang.Property; using CommonAI.ZoneServer; using CommonFroms.Utils; namespace GameEditorPlugin.Win32.Runtime { public partial class FormAbstractClient : Form { // ----------------------------------------------------------------------------------------------------------------- public float TurboX { get; set; } public bool IsFreeView { get; set; } public FormAbstractClient() { InitializeComponent(); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); this.BattlePanel.OnPanelLoaded += this.OnLoaded; this.BattlePanel.OnPanelClosed += this.OnClose; this.BattlePanel.OnTimerBeginUpdate += this.OnBeginUpdate; this.BattlePanel.OnTimerUpdate += this.OnUpdate; this.BattlePanel.OnNetworkViewClicked += this.OnNetworkViewClicked; this.BattlePanel.DisplayActor_OnRender += this.DisplayActor_OnRender; this.BattlePanel.DisplayLayer_OnRenderHUD += DisplayLayer_OnRenderHUD; this.BattlePanel.DisplayLayer_OnRenderLayer += DisplayLayer_OnRenderLayer; this.BattlePanel.Start(new BattleFactory(this)); } //----------------------------------------------------------------------------------------------------------------- public class BattleFactory : IAbstractBattleFactory { public readonly FormAbstractClient form; public BattleFactory(FormAbstractClient form) { this.form = form; } public EditorTemplates DataRoot { get { return form.DataRoot; } } public AbstractBattle GenBattle() { return form.GenBattle(); } public DisplayLayerWorld GenDisplay(PictureBox control) { return form.GenDisplay(control); } } //----------------------------------------------------------------------------------------------------------------- public virtual EditorTemplates DataRoot { get; } public virtual AbstractBattle GenBattle() { return null; } public virtual DisplayLayerWorld GenDisplay(PictureBox control) { return null; } protected virtual void OnLoaded() { } protected virtual void OnClose() { } protected virtual void OnBeginUpdate(int intervalMS) { } protected virtual void OnUpdate(int intervalMS) { } protected virtual void OnNetworkViewClicked() { } protected virtual void DisplayActor_OnRender(Graphics g, DisplayGameUnit unit) { } protected virtual void DisplayLayer_OnRenderHUD(Graphics g) { } protected virtual void DisplayLayer_OnRenderLayer(Graphics g) { } private void BattlePanel_Load(object sender, EventArgs e) { } } }