Exemplo n.º 1
0
 public abstract int FindInt(int nCol, Int64 value, ref NFDataList varResult);
Exemplo n.º 2
0
 public abstract int FindFloat(int nCol, double value, ref NFDataList varResult);
Exemplo n.º 3
0
 // set data
 public abstract int SetValue(int nRow, NFDataList var);
Exemplo n.º 4
0
 //public abstract int FindRow( int nRow );
 public abstract int FindColValue(int nCol, NFDataList var, ref NFDataList varResult);
Exemplo n.º 5
0
 public abstract void DoEvent(int nEventID, NFDataList valueList);
Exemplo n.º 6
0
 public abstract int AddRow(int nRow, NFDataList var);
Exemplo n.º 7
0
        private void LoadInstanceElement(NFIClass xLogicClass)
        {
            string strLogicPath = mstrRootPath;

            strLogicPath += xLogicClass.GetInstance();

            XmlDocument xmldoc = new XmlDocument();

            xmldoc.Load(strLogicPath);

            XmlNode xRoot = xmldoc.SelectSingleNode("XML");

            XmlNodeList xNodeList = xRoot.SelectNodes("Object");

            for (int i = 0; i < xNodeList.Count; ++i)
            {
                //NFCLog.Instance.Log("Class:" + xLogicClass.GetName());

                XmlNode      xNodeClass = xNodeList.Item(i);
                XmlAttribute strID      = xNodeClass.Attributes["Id"];

                //NFCLog.Instance.Log("ClassID:" + strID.Value);

                NFIElement xElement = GetElement(strID.Value);
                if (null == xElement)
                {
                    xElement = new NFCElement();
                    AddElement(strID.Value, xElement);
                    xLogicClass.AddConfigName(strID.Value);

                    XmlAttributeCollection xCollection = xNodeClass.Attributes;
                    for (int j = 0; j < xCollection.Count; ++j)
                    {
                        XmlAttribute xAttribute = xCollection[j];
                        NFIProperty  xProperty  = xLogicClass.GetPropertyManager().GetProperty(xAttribute.Name);
                        if (null != xProperty)
                        {
                            NFDataList.VARIANT_TYPE eType = xProperty.GetType();
                            switch (eType)
                            {
                            case NFDataList.VARIANT_TYPE.VTYPE_INT:
                            {
                                NFDataList xValue = new NFDataList();
                                xValue.AddInt(int.Parse(xAttribute.Value));
                                NFIProperty property = xElement.GetPropertyManager().AddProperty(xAttribute.Name, xValue);
                                property.SetUpload(xProperty.GetUpload());
                            }
                            break;

                            case NFDataList.VARIANT_TYPE.VTYPE_FLOAT:
                            {
                                NFDataList xValue = new NFDataList();
                                xValue.AddFloat(float.Parse(xAttribute.Value));
                                NFIProperty property = xElement.GetPropertyManager().AddProperty(xAttribute.Name, xValue);
                                property.SetUpload(xProperty.GetUpload());
                            }
                            break;

                            case NFDataList.VARIANT_TYPE.VTYPE_STRING:
                            {
                                NFDataList xValue = new NFDataList();
                                xValue.AddString(xAttribute.Value);
                                NFIProperty property = xElement.GetPropertyManager().AddProperty(xAttribute.Name, xValue);
                                property.SetUpload(xProperty.GetUpload());
                            }
                            break;

                            case NFDataList.VARIANT_TYPE.VTYPE_OBJECT:
                            {
                                NFDataList xValue = new NFDataList();
                                xValue.AddObject(new NFGUID(0, int.Parse(xAttribute.Value)));
                                NFIProperty property = xElement.GetPropertyManager().AddProperty(xAttribute.Name, xValue);
                                property.SetUpload(xProperty.GetUpload());
                            }
                            break;

                            default:
                                break;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 8
0
 public abstract int FindVector3(int nCol, NFVector3 value, ref NFDataList varResult);
Exemplo n.º 9
0
 public int FindTargetObject(NFGUID ident, string strSkillConfigID, ref NFDataList valueList)
 {
     return(valueList.Count());
 }
Exemplo n.º 10
0
 public abstract void DoEvent(NFDataList valueList);
Exemplo n.º 11
0
        private void LoadLogicClassRecord(string strName)
        {
            NFIClass xLogicClass = GetElement(strName);

            if (null != xLogicClass)
            {
                string strLogicPath = mstrPath + xLogicClass.GetPath();
                strLogicPath = strLogicPath.Replace(".xml", "");

                TextAsset textAsset = (TextAsset)Resources.Load(strLogicPath);

                XmlDocument xmldoc = new XmlDocument();
                xmldoc.LoadXml(textAsset.text);
                XmlNode xRoot = xmldoc.SelectSingleNode("XML");

                XmlNode xNodePropertys = xRoot.SelectSingleNode("Records");
                if (null != xNodePropertys)
                {
                    XmlNodeList xNodeList = xNodePropertys.SelectNodes("Record");
                    if (null != xNodeList)
                    {
                        for (int i = 0; i < xNodeList.Count; ++i)
                        {
                            XmlNode xRecordNode = xNodeList.Item(i);

                            string     strID     = xRecordNode.Attributes["Id"].Value;
                            string     strRow    = xRecordNode.Attributes["Row"].Value;
                            string     strUpload = xRecordNode.Attributes["Upload"].Value;
                            bool       bUpload   = strUpload.Equals("1");
                            NFDataList xValue    = new NFDataList();
                            NFDataList xTag      = new NFDataList();

                            XmlNodeList xTagNodeList = xRecordNode.SelectNodes("Col");
                            for (int j = 0; j < xTagNodeList.Count; ++j)
                            {
                                XmlNode xColTagNode = xTagNodeList.Item(j);

                                XmlAttribute strTagID   = xColTagNode.Attributes["Tag"];
                                XmlAttribute strTagType = xColTagNode.Attributes["Type"];

                                xTag.AddString(strTagID.Value);

                                switch (strTagType.Value)
                                {
                                case "int":
                                {
                                    xValue.AddInt(0);
                                }
                                break;

                                case "float":
                                {
                                    xValue.AddFloat(0.0);
                                }
                                break;

                                case "string":
                                {
                                    xValue.AddString("");
                                }
                                break;

                                case "object":
                                {
                                    xValue.AddObject(new NFGUID(0, 0));
                                }
                                break;

                                case "vector2":
                                {
                                    xValue.AddVector2(NFVector2.Zero());
                                }
                                break;

                                case "vector3":
                                {
                                    xValue.AddVector3(NFVector3.Zero());
                                }
                                break;

                                default:
                                    break;
                                }
                            }
                            NFIRecord xRecord = xLogicClass.GetRecordManager().AddRecord(strID, int.Parse(strRow), xValue, xTag);
                            xRecord.SetUpload(bUpload);
                        }
                    }
                }
            }
        }
Exemplo n.º 12
0
 public abstract NFIRecord AddRecord(string strRecordName, int nRow, NFDataList varData, NFDataList varTag);
Exemplo n.º 13
0
        internal void OnObjectPropertyEntry(UInt16 id, MemoryStream stream)
        {
            NFMsg.MsgBase xMsg = new NFMsg.MsgBase();
            xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream);

            NFMsg.MultiObjectPropertyList xMultiObjectPropertyList = new NFMsg.MultiObjectPropertyList();
            xMultiObjectPropertyList = Serializer.Deserialize <NFMsg.MultiObjectPropertyList>(new MemoryStream(xMsg.msg_data));

            for (int i = 0; i < xMultiObjectPropertyList.multi_player_property.Count; i++)
            {
                NFMsg.ObjectPropertyList xPropertyData = xMultiObjectPropertyList.multi_player_property[i];
                NFIObject          go = mKernelModule.GetObject(mHelpModule.PBToNF(xPropertyData.player_id));
                NFIPropertyManager xPropertyManager = go.GetPropertyManager();

                for (int j = 0; j < xPropertyData.property_int_list.Count; j++)
                {
                    string      strPropertyName = System.Text.Encoding.Default.GetString(xPropertyData.property_int_list[j].property_name);
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        NFDataList varList = new NFDataList();
                        varList.AddInt(0);

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetInt(xPropertyData.property_int_list[j].data);
                }

                for (int j = 0; j < xPropertyData.property_float_list.Count; j++)
                {
                    string      strPropertyName = System.Text.Encoding.Default.GetString(xPropertyData.property_float_list[j].property_name);
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        NFDataList varList = new NFDataList();
                        varList.AddFloat(0);

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetFloat(xPropertyData.property_float_list[j].data);
                }

                for (int j = 0; j < xPropertyData.property_string_list.Count; j++)
                {
                    string      strPropertyName = System.Text.Encoding.Default.GetString(xPropertyData.property_string_list[j].property_name);
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        NFDataList varList = new NFDataList();
                        varList.AddString("");

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetString(System.Text.Encoding.Default.GetString(xPropertyData.property_string_list[j].data));
                }

                for (int j = 0; j < xPropertyData.property_object_list.Count; j++)
                {
                    string      strPropertyName = System.Text.Encoding.Default.GetString(xPropertyData.property_object_list[j].property_name);
                    NFIProperty xProperty       = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        NFDataList varList = new NFDataList();
                        varList.AddObject(new NFGUID());

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetObject(mHelpModule.PBToNF(xPropertyData.property_object_list[j].data));
                }
            }
        }
Exemplo n.º 14
0
 public abstract int FindString(int nCol, string value, ref NFDataList varResult);
Exemplo n.º 15
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);
        }
Exemplo n.º 16
0
 public abstract int FindObject(int nCol, NFGUID value, ref NFDataList varResult);
Exemplo n.º 17
0
        public override int FindRecordRow(NFGUID self, string strRecordName, int nCol, NFVector3 nValue, ref NFDataList xDatalist)
        {
            if (mhtObject.ContainsKey(self))
            {
                NFIObject xGameObject = (NFIObject)mhtObject[self];
                NFIRecord xRecord     = xGameObject.GetRecordManager().GetRecord(strRecordName);
                if (null != xRecord)
                {
                    return(xRecord.FindVector3(nCol, nValue, ref xDatalist));
                }
            }

            return(-1);
        }
Exemplo n.º 18
0
 public NFRecord(NFGUID self, string strRecordName, int nRow, NFDataList varData, NFDataList varTag)
 {
     mSelf          = self;
     mnRow          = nRow;
     mstrRecordName = strRecordName;
     mVarRecordType = new NFDataList(varData);
     mxTag          = new NFDataList(varTag);
 }
Exemplo n.º 19
0
        public override NFIRecord AddRecord(string strRecordName, int nRow, NFDataList varData, NFDataList varTag)
        {
            NFIRecord record = new NFRecord(mSelf, strRecordName, nRow, varData, varTag);

            mhtRecord.Add(strRecordName, record);

            return(record);
        }