public new object Clone() { EventAPI api = new EventAPI(); api.DBID = this.DBID; api.ReturnType = this.ReturnType; api.strText = this.strText; api.combText = this.combText; api.ArgList = this.ArgList; api.Parent = this.Parent; if (this.ArgList != null) { for (int i = 0; i < this.ArgList.Length; i++) { if (i >= this.ArgValues.Count || this.ArgValues[i] == null) api.ArgValues.Add(null); else api.ArgValues.Add(this.ArgValues[i].Clone() as Exp); } } return api; }
public EventAPI GetEventAPI() { if (this.m_eventAPI != null) return this.m_eventAPI; EventAPI api = new EventAPI(); api.DBID = this.DBID; api.Parent = this; api.combText = this.combText; api.ArgList = this.ArgList; api.ArgValues = new List<Exp>(); for (int i = 0; i < api.ArgList.Length; i++) { api.ArgValues.Add(null); } return api; }
public GameEvent(int DBID):base(DBID) { this.m_eventAPI = GetEventAPI(); }
public override void Reload() { base.Reload(); if (m_eventAPI == null) m_eventAPI = GetEventAPI(); else { m_eventAPI.Parent = this; m_eventAPI.combText = this.combText; m_eventAPI.ArgList = this.ArgList; if(m_eventAPI.ArgValues.Count != m_eventAPI.ArgList.Length) { //重读后发现事件参数个数变化 if(m_eventAPI.ArgValues.Count < m_eventAPI.ArgList.Length) { for (int i = 0; i < m_eventAPI.ArgList.Length - m_eventAPI.ArgValues.Count; i++) m_eventAPI.ArgValues.Add(null); throw new Exception("事件" + this.ToString() + "的参数个数变多了。"); } else { throw new Exception("事件" + this.ToString() + "的参数个数变少。原流程图末尾的参数将被删除。"); } } foreach(Exp exp in m_eventAPI.ArgValues) { if (exp != null) ExpManager.ReloadExp(exp); } } }
public GameEvent():base() { this.m_eventAPI = GetEventAPI(); }