123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- using CommonAI.Zone.Formula;
- using CommonAI.ZoneClient;
- using CommonLang.Log;
- namespace XmdsCommon.ZoneClient.XmdsClientVirtual
- {
- public class XmdsClientVirtual : IVirtualClientUnit
- {
- protected static Logger mLog = LoggerFactory.GetLogger("XmdsClientVirtual");
- protected ZoneUnit mOwner = null;
- public virtual void OnInit(ZoneUnit owner)
- {
- mOwner = owner;
- mOwner.OnDoEvent += MOwner_OnDoEvent;
- }
- protected virtual void MOwner_OnDoEvent(ZoneObject obj, CommonAI.Zone.ObjectEvent e)
- {
- }
- public virtual void OnDispose(ZoneUnit owner)
- {
- if (mOwner != null)
- {
- mOwner.OnDoEvent -= MOwner_OnDoEvent;
- mOwner = null;
- }
- }
- public virtual bool IsEnemy(ZoneUnit unit)
- {
- bool ret = false;
- ret = this.mOwner.Force != unit.Force ? true : false;
- return ret;
- }
- public virtual bool IsAllies(ZoneUnit unit)
- {
- bool ret = false;
- ret = this.mOwner.Force == unit.Force ? true : false;
- return ret;
- }
- public virtual string GetPlayerUUID()
- {
- return null;
- }
- public virtual XmdsClientVirtual GetUnitVirtual(uint ObjID)
- {
- var unit = mOwner.Parent.GetUnit(ObjID);
- if (unit != null)
- {
- return unit.Virtual as XmdsClientVirtual;
- }
- return null;
- }
- }
- }
|