using CommonAI.Zone.Helper; using CommonAI.Zone.Instance; using CommonAI.Zone.Formula; using System; using System.Collections.Generic; using System.Linq; using System.Text; using CommonLang.IO; using CommonLang.Xml; using CommonLang; using CommonLang.Protocol; namespace CommonAI.Zone.Simple { public class SimpleInstanceZoneFactory : InstanceZoneFactory { private SimpleFormula mFormula = new SimpleFormula(); public override IFormula Formula { get { return mFormula; } } public SimpleInstanceZoneFactory() { } //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- public override IItemProperties CreateItemProperties() { return new SimpleFormula.SimpleItemProperties(); } public override IUnitProperties CreateUnitProperties() { return new SimpleFormula.SimpleUnitProperties(); } public override IAttackProperties CreateAttackProperties() { return new SimpleFormula.SimpleAttackProperties(); } public override IBuffProperties CreateBuffProperties() { return new SimpleFormula.SimpleBuffProperties(); } public override ISkillProperties CreateSkillProperties() { return new SimpleFormula.SimpleSkillProperties(); } public override ISpellProperties CreateSpellProperties() { return new SimpleFormula.SimpleSpellProperties(); } public override IUnitTriggerProperties CreateTriggerProperties() { return new SimpleFormula.SimpleUnitTriggerProperties(); } public override ISceneProperties CreateSceneProperties() { return new SimpleFormula.SimpleSceneProperties(); } public override ICommonConfig CreateCommonCFG() { return new SimpleFormula.SimpleCFG(); } public override IQuestAdapter CreateQuestAdapter(InstanceZone zone) { return new SimpleQuestAdapter(zone); } } //-------------------------------------------------------------------------------- public class SimpleQuestAdapter : IQuestAdapter { public SimpleQuestAdapter(InstanceZone zone) : base(zone) { } public override void DoAcceptQuest(string playerUUID, string quest, string args) { } public override void DoCommitQuest(string playerUUID, string quest, string args) { } public override void DoDropQuest(string playerUUID, string quest, string args) { } public override void DoSendMsgToPlayer(string playerUUID, IMessage msg) { } public override void DoUpdateQuestStatus(string playerUUID, string quest, string key, string value) { } } public class SimpleHateSystem : HateSystem { public SimpleHateSystem(InstanceUnit owner) : base(owner) { } } public class SimpleDistanceHateSystem : HateSystem { public SimpleDistanceHateSystem(InstanceUnit owner) : base(owner) { } public override InstanceUnit GetHated(bool onlyMonster = false) { base.Sort(); return base.GetHated(onlyMonster); } public override int Compare(HateInfo x, HateInfo y) { float dx = CMath.getDistanceSquare(x.Unit.X, x.Unit.Y, Owner.X, Owner.Y); float dy = CMath.getDistanceSquare(y.Unit.X, y.Unit.Y, Owner.X, Owner.Y); return (int)(dx - dy); } } //-------------------------------------------------------------------------------- public class SimpleFormula : IFormula { //---------------------------------------------------------------------------------------------- public class SimpleCFG : ICommonConfig { public void init() { } } public class SimpleUnitProperties : IUnitProperties { public SimpleUnitProperties() { } public object Clone() { return XmlUtil.CloneObject(this); } public void WriteExternal(IOutputStream output) { } public void ReadExternal(IInputStream input) { } public void OnInit(InstanceUnit owner) { } } public class SimpleAttackProperties : IAttackProperties { public int GetAttackID() { return 0; } public object Clone() { return XmlUtil.CloneObject(this); } public void WriteExternal(IOutputStream output) { } public void ReadExternal(IInputStream input) { } } public class SimpleBuffProperties : IBuffProperties { public object Clone() { return XmlUtil.CloneObject(this); } public void WriteExternal(IOutputStream output) { } public void ReadExternal(IInputStream input) { } } public class SimpleItemProperties : IItemProperties { public object Clone() { return XmlUtil.CloneObject(this); } public void WriteExternal(IOutputStream output) { } public void ReadExternal(IInputStream input) { } } public class SimpleSkillProperties : ISkillProperties { public object Clone() { return XmlUtil.CloneObject(this); } public void WriteExternal(IOutputStream output) { } public void ReadExternal(IInputStream input) { } public XmdsSkillType GetSkillType() { return XmdsSkillType.none; } public int GetSkillUseTimes() { return 0; } public int GetSkillAddTimeInterval() { return 0; } } public class SimpleSpellProperties : ISpellProperties { public object Clone() { return XmlUtil.CloneObject(this); } public void WriteExternal(IOutputStream output) { } public void ReadExternal(IInputStream input) { } } public class SimpleUnitTriggerProperties : IUnitTriggerProperties { public object Clone() { return XmlUtil.CloneObject(this); } public void WriteExternal(IOutputStream output) { } public void ReadExternal(IInputStream input) { } } public class SimpleSceneProperties : ISceneProperties { public void OnInit(InstanceZone owner) { } public object Clone() { return XmlUtil.CloneObject(this); } public void WriteExternal(IOutputStream output) { } public void ReadExternal(IInputStream input) { } public byte GetAutoFightFlag() { return 0; } } //---------------------------------------------------------------------------------------------- } }