public NFCDataList(NFIDataList src) { for (int i = 0; i < src.Count(); i++ ) { switch (src.GetType(i)) { case VARIANT_TYPE.VTYPE_INT: AddInt(src.IntVal(i)); break; case VARIANT_TYPE.VTYPE_FLOAT: AddFloat(src.FloatVal(i)); break; case VARIANT_TYPE.VTYPE_DOUBLE: AddDouble(src.DoubleVal(i)); break; case VARIANT_TYPE.VTYPE_STRING: AddString(src.StringVal(i)); break; case VARIANT_TYPE.VTYPE_OBJECT: AddObject(src.ObjectVal(i)); break; default: break; } } }
//public override int FindRow( int nRow ); public override int FindColValue(int nCol, NFIDataList var) { for (int i = 0; i < mhtRecordVec.Count; i++ ) { NFIDataList valueList = (NFIDataList)mhtRecordVec[i]; switch (valueList.GetType(0)) { case NFIDataList.VARIANT_TYPE.VTYPE_INT: return FindInt(nCol, var.IntVal(0)); case NFIDataList.VARIANT_TYPE.VTYPE_FLOAT: return FindInt(nCol, var.IntVal(0)); case NFIDataList.VARIANT_TYPE.VTYPE_DOUBLE: return FindInt(nCol, var.IntVal(0)); case NFIDataList.VARIANT_TYPE.VTYPE_STRING: return FindInt(nCol, var.IntVal(0)); case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT: return FindObject(nCol, var.ObjectVal(0)); default: break; } } return -1; }
public override NFIRecord AddRecord(string strRecordName, int nRow, NFIDataList varData) { NFIRecord record = new NFCRecord(mSelf, strRecordName, nRow, varData); mhtRecord.Add(strRecordName, record); return record; }
public override void DoEvent(NFIDataList valueList) { if (null != mHandlerDel) { mHandlerDel(mSelf, mnEventID, mArgValueList, valueList); } }
public NFCRecord(NFIDENTID self, string strRecordName, int nRow, NFIDataList varData) { mSelf = self; mnRow = nRow; mstrRecordName = strRecordName; mVarRecordType = new NFCDataList(varData); }
public override void DoEvent(int nEventID, NFIDataList valueList) { if (mhtEvent.ContainsKey(nEventID)) { NFIEvent identEvent = (NFIEvent)mhtEvent[nEventID]; identEvent.DoEvent(valueList); } }
public NFCHeartBeat(NFIDENTID self, string strHeartBeatName, float fTime, NFIDataList valueList) { mSelf = self; mstrHeartBeatName = strHeartBeatName; mfTime = fTime; mfOldTime = fTime; mArgValueList = valueList; }
public override void AddHeartBeat(string strHeartBeatName, float fTime, NFIHeartBeat.HeartBeatEventHandler handler, NFIDataList valueList) { if (!mhtHeartBeat.ContainsKey(strHeartBeatName)) { NFIHeartBeat xHeartBeat = new NFCHeartBeat(mSelf, strHeartBeatName, fTime, valueList); mhtHeartBeat.Add(strHeartBeatName, xHeartBeat); xHeartBeat.RegisterCallback(handler); } }
public override bool AddHeartBeat(NFIDENTID self, string strHeartBeatName, NFIHeartBeat.HeartBeatEventHandler handler, float fTime, NFIDataList valueList) { NFIObject xGameObject = GetObject(self); if (null != xGameObject) { xGameObject.GetHeartBeatManager().AddHeartBeat(strHeartBeatName, fTime, handler, valueList); } return true; }
public override void RegisterCallback(int nEventID, NFIEvent.EventHandler handler, NFIDataList valueList) { if (!mhtEvent.ContainsKey(nEventID)) { mhtEvent.Add(nEventID, new NFCEvent(mSelf, nEventID, valueList)); } NFIEvent identEvent = (NFIEvent)mhtEvent[nEventID]; identEvent.RegisterCallback(handler); }
public override NFIProperty AddProperty(string strPropertyName, NFIDataList varData) { NFIProperty xProperty = null; if (!mhtProperty.ContainsKey(strPropertyName)) { xProperty = new NFCProperty(mSelf, strPropertyName, varData); mhtProperty[strPropertyName] = xProperty; } return xProperty; }
public override bool SetProperty(string strPropertyName, NFIDataList varData) { if (mhtProperty.ContainsKey(strPropertyName)) { NFIProperty xProperty = (NFCProperty)mhtProperty[strPropertyName]; if (null != xProperty) { xProperty.SetValue(varData); } } return true; }
public override int AddRow(int nRow, NFIDataList var) { if(nRow >= 0 && nRow < mnRow) { if (!mhtRecordVec.ContainsKey(nRow)) { mhtRecordVec[nRow] = new NFCDataList(var); if (null != doHandleDel) { doHandleDel(mSelf, mstrRecordName, eRecordOptype.Add, nRow, 0, var, var); } return nRow; } } return -1; }
public abstract NFIRecord AddRecord(string strRecordName, int nRow, NFIDataList varData);
public override void SetValue(NFIDataList varData) { mVarProperty = varData; }
static void OnRecordEventHandler(NFIDENTID self, string strRecordName, NFIRecord.eRecordOptype eType, int nRow, int nCol, NFIDataList oldVar, NFIDataList newVar) { Console.Write(self); Console.Write(" "); Console.Write(strRecordName); Console.Write(" "); Console.Write(eType.ToString()); Console.Write(" "); Console.Write(nRow); Console.Write(" "); Console.Write(nCol); Console.Write(" "); Console.Write(oldVar.IntVal(0)); Console.Write(" "); Console.Write(newVar.IntVal(0)); Console.WriteLine(" "); }
public abstract int AddRow(int nRow, NFIDataList var);
// set data public abstract int SetValue(int nRow, NFIDataList var);
public abstract void DoEvent(NFIDataList valueList);
public override bool AddHeartBeat(NFIDENTID self, string strHeartBeatName, NFIHeartBeat.HeartBeatEventHandler handler, float fTime, NFIDataList valueList) { NFIObject xGameObject = GetObject(self); if (null != xGameObject) { xGameObject.GetHeartBeatManager().AddHeartBeat(strHeartBeatName, fTime, handler, valueList); } return(true); }
public abstract bool SetProperty(string strPropertyName, NFIDataList varData);
public abstract NFIProperty AddProperty(string strPropertyName, NFIDataList varData);
static void OnPropertydHandler(NFIDENTID self, string strProperty, NFIDataList oldVar, NFIDataList newVar) { Debug.Log(self); Debug.Log(" "); Debug.Log(strProperty); Debug.Log(" "); Debug.Log(oldVar.IntVal(0)); Debug.Log(" "); Debug.Log(newVar.IntVal(0)); Debug.Log(" "); }
static void HeartBeatEventHandler(NFIDENTID self, string strHeartBeat, float fTime, NFIDataList valueList) { Console.Write(self); Console.Write(" "); Console.Write(strHeartBeat); Console.Write(" "); Console.Write(fTime.ToString()); Console.WriteLine(" "); }
static void OnRecordEventHandler(NFIDENTID self, string strRecordName, NFIRecord.eRecordOptype eType, int nRow, int nCol, NFIDataList oldVar, NFIDataList newVar) { Debug.Log(self); Debug.Log(" "); Debug.Log(strRecordName); Debug.Log(" "); Debug.Log(eType.ToString()); Debug.Log(" "); Debug.Log(nRow); Debug.Log(" "); Debug.Log(nCol); Debug.Log(" "); Debug.Log(oldVar.IntVal(0)); Debug.Log(" "); Debug.Log(newVar.IntVal(0)); Debug.Log(" "); }
static void HeartBeatEventHandler(NFIDENTID self, string strHeartBeat, float fTime, NFIDataList valueList) { Debug.Log(self); Debug.Log(" "); Debug.Log(strHeartBeat); Debug.Log(" "); Debug.Log(fTime.ToString()); Debug.Log(" "); }
public abstract void AddHeartBeat(string strHeartBeatName, float fTime, NFIHeartBeat.HeartBeatEventHandler handler, NFIDataList valueList);
public abstract void RegisterCallback(int nEventID, NFIEvent.EventHandler handler, NFIDataList valueList);
public override void RegisterEventCallBack(NFIDENTID self, int nEventID, NFIEvent.EventHandler handler, NFIDataList valueList) { NFIObject xGameObject = GetObject(self); if (null != xGameObject) { xGameObject.GetEventManager().RegisterCallback(nEventID, handler, valueList); } }
public override NFIObject CreateObject(NFIDENTID self, int nContainerID, int nGroupID, string strClassName, string strConfigIndex, NFIDataList arg) { if (!mhtObject.ContainsKey(self)) { NFIObject xNewObject = new NFCObject(self, nContainerID, nGroupID, strClassName, strConfigIndex); mhtObject.Add(self, xNewObject); NFCDataList varConfigID = new NFCDataList(); varConfigID.AddString(strConfigIndex); xNewObject.GetPropertyManager().AddProperty("ConfigID", varConfigID); NFCDataList varConfigClass = new NFCDataList(); varConfigClass.AddString(strClassName); xNewObject.GetPropertyManager().AddProperty("ClassName", varConfigClass); if (arg.Count() % 2 == 0) { for (int i = 0; i < arg.Count() - 1; i += 2) { string strPropertyName = arg.StringVal(i); NFIDataList.VARIANT_TYPE eType = arg.GetType(i + 1); switch (eType) { case NFIDataList.VARIANT_TYPE.VTYPE_INT: { NFIDataList xDataList = new NFCDataList(); xDataList.AddInt(arg.IntVal(i + 1)); xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList); } break; case NFIDataList.VARIANT_TYPE.VTYPE_FLOAT: { NFIDataList xDataList = new NFCDataList(); xDataList.AddFloat(arg.FloatVal(i + 1)); xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList); } break; case NFIDataList.VARIANT_TYPE.VTYPE_DOUBLE: { NFIDataList xDataList = new NFCDataList(); xDataList.AddDouble(arg.DoubleVal(i + 1)); xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList); } break; case NFIDataList.VARIANT_TYPE.VTYPE_STRING: { NFIDataList xDataList = new NFCDataList(); xDataList.AddString(arg.StringVal(i + 1)); xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList); } break; case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT: { NFIDataList xDataList = new NFCDataList(); xDataList.AddObject(arg.ObjectVal(i + 1)); xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList); } break; default: break; } } } InitProperty(self, strClassName); InitRecord(self, strClassName); if (mhtClassHandleDel.ContainsKey(strClassName)) { ClassHandleDel xHandleDel = (ClassHandleDel)mhtClassHandleDel[strClassName]; if (null != xHandleDel && null != xHandleDel.GetHandler()) { NFIObject.ClassEventHandler xHandlerList = xHandleDel.GetHandler(); xHandlerList(self, nContainerID, nGroupID, NFIObject.CLASS_EVENT_TYPE.OBJECT_CREATE, strClassName, strConfigIndex); xHandlerList(self, nContainerID, nGroupID, NFIObject.CLASS_EVENT_TYPE.OBJECT_LOADDATA, strClassName, strConfigIndex); xHandlerList(self, nContainerID, nGroupID, NFIObject.CLASS_EVENT_TYPE.OBJECT_CREATE_FINISH, strClassName, strConfigIndex); } } //NFCLog.Instance.Log(NFCLog.LOG_LEVEL.DEBUG, "Create object: " + self.ToString() + " ClassName: " + strClassName + " SceneID: " + nContainerID + " GroupID: " + nGroupID); return(xNewObject); } return(null); }
public override NFIObject CreateObject(NFIDENTID self, int nContainerID, int nGroupID, string strClassName, string strConfigIndex, NFIDataList arg) { if (!mhtObject.ContainsKey(self)) { NFIObject xNewObject = new NFCObject(self, nContainerID, nGroupID, strClassName, strConfigIndex); mhtObject.Add(self, xNewObject); NFCDataList varConfigID = new NFCDataList(); varConfigID.AddString(strConfigIndex); xNewObject.GetPropertyManager().AddProperty("ConfigID", varConfigID); NFCDataList varConfigClass = new NFCDataList(); varConfigClass.AddString(strClassName); xNewObject.GetPropertyManager().AddProperty("ClassName", varConfigClass); if (arg.Count() % 2 == 0) { for (int i = 0; i < arg.Count() - 1; i += 2) { string strPropertyName = arg.StringVal(i); NFIDataList.VARIANT_TYPE eType = arg.GetType(i + 1); switch (eType) { case NFIDataList.VARIANT_TYPE.VTYPE_INT: { NFIDataList xDataList = new NFCDataList(); xDataList.AddInt(arg.IntVal(i+1)); xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList); } break; case NFIDataList.VARIANT_TYPE.VTYPE_FLOAT: { NFIDataList xDataList = new NFCDataList(); xDataList.AddFloat(arg.FloatVal(i + 1)); xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList); } break; case NFIDataList.VARIANT_TYPE.VTYPE_DOUBLE: { NFIDataList xDataList = new NFCDataList(); xDataList.AddDouble(arg.DoubleVal(i + 1)); xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList); } break; case NFIDataList.VARIANT_TYPE.VTYPE_STRING: { NFIDataList xDataList = new NFCDataList(); xDataList.AddString(arg.StringVal(i + 1)); xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList); } break; case NFIDataList.VARIANT_TYPE.VTYPE_OBJECT: { NFIDataList xDataList = new NFCDataList(); xDataList.AddObject(arg.ObjectVal(i + 1)); xNewObject.GetPropertyManager().AddProperty(strPropertyName, xDataList); } break; default: break; } } } InitProperty(self, strClassName); InitRecord(self, strClassName); ClassHandleDel xHandleDel = (ClassHandleDel)mhtClassHandleDel[strClassName]; if (null != xHandleDel && null != xHandleDel.GetHandler()) { NFIObject.ClassEventHandler xHandlerList = xHandleDel.GetHandler(); xHandlerList(self, nContainerID, nGroupID, NFIObject.CLASS_EVENT_TYPE.OBJECT_CREATE, strClassName, strConfigIndex); xHandlerList(self, nContainerID, nGroupID, NFIObject.CLASS_EVENT_TYPE.OBJECT_LOADDATA, strClassName, strConfigIndex); xHandlerList(self, nContainerID, nGroupID, NFIObject.CLASS_EVENT_TYPE.OBJECT_CREATE_FINISH, strClassName, strConfigIndex); } return xNewObject; } return null; }
//public abstract int FindRow( int nRow ); public abstract int FindColValue(int nCol, NFIDataList var);
public NFCProperty(NFIDENTID self, string strPropertyName, NFIDataList varData) { mSelf = self; msPropertyName = strPropertyName; mVarProperty = new NFCDataList(varData); }
static void OnPropertydHandler(NFIDENTID self, string strProperty, NFIDataList oldVar, NFIDataList newVar) { Console.Write(self); Console.Write(" "); Console.Write(strProperty); Console.Write(" "); Console.Write(oldVar.IntVal(0)); Console.Write(" "); Console.Write(newVar.IntVal(0)); Console.WriteLine(" "); }
public abstract NFIObject CreateObject(NFIDENTID self, int nContainerID, int nGroupID, string strClassName, string strConfigIndex, NFIDataList arg);
public abstract void DoEvent(int nEventID, NFIDataList valueList);
public abstract bool AddHeartBeat(NFIDENTID self, string strHeartBeatName, NFIHeartBeat.HeartBeatEventHandler handler, float fTime, NFIDataList valueList);
// set data public override int SetValue(int nRow, NFIDataList var) { if(nRow >= 0 && nRow < mnRow) { if (!mhtRecordVec.ContainsKey(nRow)) { AddRow(nRow); } mhtRecordVec[nRow] = var; return nRow; } return -1; }
public NFCEvent(NFIDENTID self, int nEventID, NFIDataList valueList) { mSelf = self; mnEventID = nEventID; mArgValueList = valueList; }
public abstract void SetValue(NFIDataList varData);
public abstract void RegisterEventCallBack(NFIDENTID self, int nEventID, NFIEvent.EventHandler handler, NFIDataList valueList);