Пример #1
0
        public NFDataList(NFDataList 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_STRING:
                    AddString(src.StringVal(i));
                    break;

                case VARIANT_TYPE.VTYPE_OBJECT:
                    AddObject(src.ObjectVal(i));
                    break;

                case VARIANT_TYPE.VTYPE_VECTOR2:
                    AddVector2(src.Vector2Val(i));
                    break;

                case VARIANT_TYPE.VTYPE_VECTOR3:
                    AddVector3(src.Vector3Val(i));
                    break;

                default:
                    break;
                }
            }
        }
Пример #2
0
        public override int FindVector3(int nCol, NFVector3 value)
        {
            NFDataList varResult = new NFDataList();
            int        nCount    = FindVector3(nCol, value, ref varResult);

            if (nCount > 0 && varResult.Count() > 0)
            {
                return((int)varResult.IntVal(0));
            }

            return(-1);
        }
Пример #3
0
        public override int FindVector3(int nCol, NFVector3 value, ref NFDataList varResult)
        {
            foreach (int i in mhtRecordVec.Keys)
            {
                NFDataList valueList = (NFDataList)mhtRecordVec[i];
                if (valueList.Vector3Val(nCol) == value)
                {
                    varResult.AddInt(i);
                }
            }

            return(varResult.Count());
        }
Пример #4
0
        void AddBasePropertyFormOther(NFIClass xLogicClass, string strOther)
        {
            NFIClass xOtherClass = GetElement(strOther);

            if (null != xLogicClass && null != xOtherClass)
            {
                NFDataList xValue = xOtherClass.GetPropertyManager().GetPropertyList();
                for (int i = 0; i < xValue.Count(); ++i)
                {
                    NFIProperty xProperty = xOtherClass.GetPropertyManager().GetProperty(xValue.StringVal(i));
                    xLogicClass.GetPropertyManager().AddProperty(xValue.StringVal(i), xProperty.GetData());
                }
            }
        }
Пример #5
0
        void AddBaseRecordFormOther(NFIClass xLogicClass, string strOther)
        {
            NFIClass xOtherClass = GetElement(strOther);

            if (null != xLogicClass && null != xOtherClass)
            {
                NFDataList xValue = xOtherClass.GetRecordManager().GetRecordList();
                for (int i = 0; i < xValue.Count(); ++i)
                {
                    NFIRecord record = xOtherClass.GetRecordManager().GetRecord(xValue.StringVal(i));

                    xLogicClass.GetRecordManager().AddRecord(xValue.StringVal(i), record.GetRows(), record.GetColsData(), record.GetTagData());
                }
            }
        }
Пример #6
0
        void InitRecord(NFGUID self, string strClassName)
        {
            NFIClass   xLogicClass = mxLogicClassModule.GetElement(strClassName);
            NFDataList xDataList   = xLogicClass.GetRecordManager().GetRecordList();

            for (int i = 0; i < xDataList.Count(); ++i)
            {
                string    strRecordyName = xDataList.StringVal(i);
                NFIRecord xRecord        = xLogicClass.GetRecordManager().GetRecord(strRecordyName);

                NFIObject        xObject        = GetObject(self);
                NFIRecordManager xRecordManager = xObject.GetRecordManager();

                NFIRecord record = xRecordManager.AddRecord(strRecordyName, xRecord.GetRows(), xRecord.GetColsData(), xRecord.GetTagData());
                if (record != null)
                {
                    record.SetUpload(xRecord.GetUpload());
                }
            }
        }
Пример #7
0
        void InitProperty(NFGUID self, string strClassName)
        {
            NFIClass   xLogicClass = mxLogicClassModule.GetElement(strClassName);
            NFDataList xDataList   = xLogicClass.GetPropertyManager().GetPropertyList();

            for (int i = 0; i < xDataList.Count(); ++i)
            {
                string      strPropertyName = xDataList.StringVal(i);
                NFIProperty xProperty       = xLogicClass.GetPropertyManager().GetProperty(strPropertyName);

                NFIObject          xObject          = GetObject(self);
                NFIPropertyManager xPropertyManager = xObject.GetPropertyManager();

                NFIProperty property = xPropertyManager.AddProperty(strPropertyName, xProperty.GetData());
                //if property==null ,means this property alreay exist in manager
                if (property != null)
                {
                    property.SetUpload(xProperty.GetUpload());
                }
            }
        }
Пример #8
0
        public override void Shut()
        {
            NFDataList xRecordList = mRecordManager.GetRecordList();

            if (null != xRecordList)
            {
                for (int i = 0; i < xRecordList.Count(); ++i)
                {
                    string    strRecordName = xRecordList.StringVal(i);
                    NFIRecord xRecord       = mRecordManager.GetRecord(strRecordName);
                    if (null != xRecord)
                    {
                        xRecord.Clear();
                    }
                }
            }

            mRecordManager   = null;
            mPropertyManager = null;

            return;
        }
Пример #9
0
        public override NFIObject CreateObject(NFGUID self, int nContainerID, int nGroupID, string strClassName, string strConfigIndex, NFDataList arg)
        {
            if (!mhtObject.ContainsKey(self))
            {
                NFIObject xNewObject = new NFObject(self, nContainerID, nGroupID, strClassName, strConfigIndex);
                mhtObject.Add(self, xNewObject);

                NFDataList.TData varConfigID = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_STRING);
                varConfigID.Set(strConfigIndex);
                xNewObject.GetPropertyManager().AddProperty("ConfigID", varConfigID);

                NFDataList.TData varConfigClass = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_STRING);
                varConfigClass.Set(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);
                        NFDataList.VARIANT_TYPE eType = arg.GetType(i + 1);
                        switch (eType)
                        {
                        case NFDataList.VARIANT_TYPE.VTYPE_INT:
                        {
                            NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_INT);
                            var.Set(arg.IntVal(i + 1));
                            xNewObject.GetPropertyManager().AddProperty(strPropertyName, var);
                        }
                        break;

                        case NFDataList.VARIANT_TYPE.VTYPE_FLOAT:
                        {
                            NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_FLOAT);
                            var.Set(arg.FloatVal(i + 1));
                            xNewObject.GetPropertyManager().AddProperty(strPropertyName, var);
                        }
                        break;

                        case NFDataList.VARIANT_TYPE.VTYPE_STRING:
                        {
                            NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_STRING);
                            var.Set(arg.StringVal(i + 1));
                            xNewObject.GetPropertyManager().AddProperty(strPropertyName, var);
                        }
                        break;

                        case NFDataList.VARIANT_TYPE.VTYPE_OBJECT:
                        {
                            NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_OBJECT);
                            var.Set(arg.ObjectVal(i + 1));
                            xNewObject.GetPropertyManager().AddProperty(strPropertyName, var);
                        }
                        break;

                        case NFDataList.VARIANT_TYPE.VTYPE_VECTOR2:
                        {
                            NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_VECTOR2);
                            var.Set(arg.Vector2Val(i + 1));
                            xNewObject.GetPropertyManager().AddProperty(strPropertyName, var);
                        }
                        break;

                        case NFDataList.VARIANT_TYPE.VTYPE_VECTOR3:
                        {
                            NFDataList.TData var = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_VECTOR3);
                            var.Set(arg.Vector3Val(i + 1));
                            xNewObject.GetPropertyManager().AddProperty(strPropertyName, var);
                        }
                        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);
        }
Пример #10
0
 public int FindTargetObject(NFGUID ident, string strSkillConfigID, ref NFDataList valueList)
 {
     return(valueList.Count());
 }