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;
         }
     }
 }
Exemple #2
0
        //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;
        }
Exemple #4
0
 public override void DoEvent(NFIDataList valueList)
 {
     if (null != mHandlerDel)
     {
         mHandlerDel(mSelf, mnEventID, mArgValueList, valueList);
     }
 }
Exemple #5
0
 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);
     }
 }
Exemple #7
0
 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);
     }
 }
Exemple #9
0
 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;
 }
Exemple #13
0
        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);
Exemple #15
0
 public override void SetValue(NFIDataList varData)
 {
     mVarProperty = varData;
 }
Exemple #16
0
 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(" ");
 }
Exemple #17
0
 public abstract int AddRow(int nRow, NFIDataList var);
Exemple #18
0
 // set data
 public abstract int SetValue(int nRow, NFIDataList var);
Exemple #19
0
 public abstract void DoEvent(NFIDataList valueList);
Exemple #20
0
        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);
Exemple #23
0
 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(" ");
 }
Exemple #24
0
 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(" ");
 }
Exemple #25
0
 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(" ");
 }
Exemple #26
0
 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(" ");
 }
Exemple #27
0
        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 abstract bool SetProperty(string strPropertyName, NFIDataList varData);
Exemple #29
0
 public abstract void AddHeartBeat(string strHeartBeatName, float fTime, NFIHeartBeat.HeartBeatEventHandler handler, NFIDataList valueList);
Exemple #30
0
 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 void RegisterCallback(int nEventID, NFIEvent.EventHandler handler, NFIDataList valueList);
Exemple #32
0
 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);
     }
 }
Exemple #33
0
        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);
        }
Exemple #34
0
        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 void AddHeartBeat(string strHeartBeatName, float fTime, NFIHeartBeat.HeartBeatEventHandler handler, NFIDataList valueList);
Exemple #36
0
 //public abstract int FindRow( int nRow );
 public abstract int FindColValue(int nCol, NFIDataList var);
Exemple #37
0
 // set data
 public abstract int SetValue(int nRow, NFIDataList var);
Exemple #38
0
 public NFCProperty(NFIDENTID self, string strPropertyName, NFIDataList varData)
 {
     mSelf          = self;
     msPropertyName = strPropertyName;
     mVarProperty   = new NFCDataList(varData);
 }
 public abstract NFIRecord AddRecord(string strRecordName, int nRow, NFIDataList varData);
Exemple #40
0
 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(" ");
 }
Exemple #41
0
 public abstract NFIObject CreateObject(NFIDENTID self, int nContainerID, int nGroupID, string strClassName, string strConfigIndex, NFIDataList arg);
Exemple #42
0
 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(" ");
 }
 public abstract void DoEvent(int nEventID, NFIDataList valueList);
 public abstract NFIProperty AddProperty(string strPropertyName, NFIDataList varData);
Exemple #45
0
        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);
            }
        }
Exemple #46
0
 public abstract bool AddHeartBeat(NFIDENTID self, string strHeartBeatName, NFIHeartBeat.HeartBeatEventHandler handler, float fTime, NFIDataList valueList);
Exemple #47
0
 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(" ");
 }
Exemple #48
0
        // 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;
        }
Exemple #49
0
 public NFCEvent(NFIDENTID self, int nEventID, NFIDataList valueList)
 {
     mSelf         = self;
     mnEventID     = nEventID;
     mArgValueList = valueList;
 }
Exemple #50
0
 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(" ");
 }
Exemple #51
0
 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(" ");
 }
Exemple #52
0
 public abstract int AddRow(int nRow, NFIDataList var);
Exemple #53
0
 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(" ");
 }
Exemple #54
0
 //public abstract int FindRow( int nRow );
 public abstract int FindColValue(int nCol, NFIDataList var);
Exemple #55
0
 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);
     }
 }
Exemple #56
0
 public abstract void SetValue(NFIDataList varData);
Exemple #57
0
 public abstract void RegisterEventCallBack(NFIDENTID self, int nEventID, NFIEvent.EventHandler handler, NFIDataList valueList);