Пример #1
0
        public override bool SetVector2(int nRow, int nCol, NFVector2 value)
        {
            if (nRow >= 0 && nRow < mnRow)
            {
                if (!mhtRecordVec.ContainsKey(nRow))
                {
                    AddRow(nRow);
                }
                NFIDataList valueList = (NFIDataList)mhtRecordVec[nRow];
                if (valueList.GetType(nCol) == NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2)
                {
                    if (valueList.Vector2Val(nCol) != value)
                    {
                        NFIDataList.TData oldValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2);
                        NFIDataList.TData newValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2);

                        oldValue.Set(valueList.Vector2Val(nCol));
                        newValue.Set(value);

                        valueList.SetVector2(nCol, value);

                        if (null != doHandleDel)
                        {
                            doHandleDel(mSelf, mstrRecordName, eRecordOptype.Update, nRow, nCol, oldValue, newValue);
                        }
                    }
                }

                return(true);
            }

            return(false);
        }
Пример #2
0
 public static NFVector2 add(NFVector2 va, NFVector2 vb)
 {
     NFVector2 vector = new NFVector2();
     vector.SetX(va.X() + vb.X());
     vector.SetY(va.Y() + vb.Y());
     return vector;
 }
Пример #3
0
        public override bool SetVector2(NFVector2 value)
        {
            if (NFDataList.VARIANT_TYPE.VTYPE_VECTOR2 != mxData.GetType())
            {
                UnityEngine.Debug.LogError(this.msPropertyName + " is " + mxData.GetType().ToString() + " but you set type " + NFDataList.VARIANT_TYPE.VTYPE_VECTOR2.ToString());

                return(false);
            }

            if (mxData.Vector2Val() != value)
            {
                NFDataList.TData oldValue = new NFDataList.TData(mxData);
                NFDataList.TData newValue = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_VECTOR2);
                newValue.Set(value);

                mxData.Set(value);

                if (null != doHandleDel)
                {
                    doHandleDel(mSelf, msPropertyName, oldValue, newValue);
                }
            }

            return(true);
        }
Пример #4
0
        public bool AddVector2(NFVector2 value)
        {
            TData data = new TData(VARIANT_TYPE.VTYPE_VECTOR2);

            data.Set(value);

            return(AddDataObject(ref data));
        }
Пример #5
0
        static public NFMsg.Vector2 NFToPB(NFVector2 value)
        {
            NFMsg.Vector2 vector = new NFMsg.Vector2();
            vector.x = value.X();
            vector.y = value.Y();

            return(vector);
        }
Пример #6
0
        public static NFVector2 sub(NFVector2 va, NFVector2 vb)
        {
            NFVector2 vector = new NFVector2();

            vector.SetX(va.X() - vb.X());
            vector.SetY(va.Y() - vb.Y());
            return(vector);
        }
Пример #7
0
        public NFMsg.Vector2 NFToPB(NFVector2 value)
        {
            NFMsg.Vector2 vector = new NFMsg.Vector2();
            vector.X = value.X();
            vector.Y = value.Y();

            return(vector);
        }
Пример #8
0
        static public NFVector2 PBToNF(NFMsg.Vector2 value)
        {
            NFVector2 vector = new NFVector2();

            vector.SetX(value.x);
            vector.SetY(value.y);

            return(vector);
        }
Пример #9
0
        public override bool SetPropertyVector2(NFGUID self, string strPropertyName, NFVector2 objectValue)
        {
            if (mhtObject.ContainsKey(self))
            {
                NFIObject xGameObject = (NFIObject)mhtObject[self];
                return(xGameObject.SetPropertyVector2(strPropertyName, objectValue));
            }

            return(false);
        }
Пример #10
0
            public bool Set(NFVector2 value)
            {
                if (nType == VARIANT_TYPE.VTYPE_VECTOR2)
                {
                    mData = value;
                    return(true);
                }

                return(false);
            }
Пример #11
0
        public override int FindVector2(int nCol, NFVector2 value)
        {
            NFDataList varResult = new NFDataList();
            int        nCount    = FindVector2(nCol, value, ref varResult);

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

            return(-1);
        }
Пример #12
0
        public bool SetVector2(int index, NFVector2 value)
        {
            TData data = GetData(index);

            if (data != null && data.GetType() == VARIANT_TYPE.VTYPE_VECTOR2)
            {
                data.Set(value);

                return(true);
            }

            return(false);
        }
Пример #13
0
        public override int FindVector2(int nCol, NFVector2 value, ref NFIDataList varResult)
        {
            foreach (int i in mhtRecordVec.Keys)
            {
                NFIDataList valueList = (NFIDataList)mhtRecordVec[i];
                if (valueList.Vector2Val(nCol) == value)
                {
                    varResult.AddInt(i);
                }
            }

            return(varResult.Count());
        }
Пример #14
0
        public override bool SetPropertyVector2(string strPropertyName, NFVector2 obj)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                NFDataList valueList = new NFDataList();
                valueList.AddVector2(new NFVector2());
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetVector2(obj);
            return(true);
        }
Пример #15
0
        public void RequirePropertyVector2(NFGUID objectID, string strPropertyName, NFVector2 newVar)
        {
            NFMsg.ObjectPropertyVector2 xData = new NFMsg.ObjectPropertyVector2();
            xData.PlayerId = mHelpModule.NFToPB(objectID);

            NFMsg.PropertyVector2 xProperty = new NFMsg.PropertyVector2();
            xProperty.PropertyName = ByteString.CopyFromUtf8(strPropertyName);
            xProperty.Data         = mHelpModule.NFToPB(newVar);
            xData.PropertyList.Add(xProperty);

            mxBody.SetLength(0);
            xData.WriteTo(mxBody);


            SendMsg((int)NFMsg.EGameMsgID.AckPropertyVector2, mxBody);
        }
Пример #16
0
        public override bool SetVector2(NFVector2 value)
        {
            if (mxData.Vector2Val() != value)
            {
                NFIDataList.TData oldValue = new NFIDataList.TData(mxData);
                NFIDataList.TData newValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2);
                newValue.Set(value);

                mxData.Set(value);

                if (null != doHandleDel)
                {
                    doHandleDel(mSelf, msPropertyName, oldValue, newValue);
                }
            }

            return(true);
        }
Пример #17
0
        private void LoadLogicClassRecord(string strName)
        {
            NFIClass xLogicClass = GetElement(strName);

            if (null != xLogicClass)
            {
                string strLogicPath = mstrPath + xLogicClass.GetPath();

                XmlDocument xmldoc = new XmlDocument();

                if (mbEncrypt)
                {
                    ///////////////////////////////////////////////////////////////////////////////////////
                    StreamReader cepherReader = new StreamReader(strLogicPath);;
                    string       strContent   = cepherReader.ReadToEnd();
                    cepherReader.Close();

                    byte[] data = Convert.FromBase64String(strContent);
                    string res  = System.Text.ASCIIEncoding.Default.GetString(data);

                    xmldoc.LoadXml(res);
                    /////////////////////////////////////////////////////////////////
                }
                else
                {
                    xmldoc.Load(strLogicPath);
                }

                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();

                            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"];


                                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);
                            xRecord.SetUpload(bUpload);
                        }
                    }
                }
            }
        }
Пример #18
0
 public abstract int FindRecordRow(NFGUID self, string strRecordName, int nCol, NFVector2 nValue, ref NFIDataList xDatalist);
Пример #19
0
        public override bool SetVector2(int nRow, int nCol, NFVector2 value)
        {
            if (nRow >= 0 && nRow < mnRow)
            {
                if (!mhtRecordVec.ContainsKey(nRow))
                {
                    AddRow(nRow);
                }
                NFIDataList valueList = (NFIDataList)mhtRecordVec[nRow];
                if (valueList.GetType(nCol) == NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2)
                {
                    if (valueList.Vector2Val(nCol) != value)
                    {
                        NFIDataList.TData oldValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2);
                        NFIDataList.TData newValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2);

                        oldValue.Set(valueList.Vector2Val(nCol));
                        newValue.Set(value);

                        valueList.SetVector2(nCol, value);

                        if (null != doHandleDel)
                        {
                            doHandleDel(mSelf, mstrRecordName, eRecordOptype.Update, nRow, nCol, oldValue, newValue);
                        }
                    }
                }

                return true;
            }

            return false;
        }
Пример #20
0
        public override int FindRecordRow(NFGUID self, string strRecordName, int nCol, NFVector2 nValue, ref NFIDataList xDatalist)
        {
            if (mhtObject.ContainsKey(self))
            {
                NFIObject xGameObject = (NFIObject)mhtObject[self];
                NFrame.NFIRecord xRecord = xGameObject.GetRecordManager().GetRecord(strRecordName);
                if (null != xRecord)
                {
                    return xRecord.FindVector2(nCol, nValue, ref xDatalist);
                }
            }

            return -1;
        }
Пример #21
0
 public abstract bool SetVector2(int index, NFVector2 value);
Пример #22
0
        public static float Distance(NFVector2 va, NFVector2 vb)
        {
            NFVector2 vector = NFVector2.sub(va, vb);

            return(vector.Length());
        }
Пример #23
0
        public override bool SetPropertyVector2(NFGUID self, string strPropertyName, NFVector2 objectValue)
        {
            if (mhtObject.ContainsKey(self))
            {
                NFIObject xGameObject = (NFIObject)mhtObject[self];
                return xGameObject.SetPropertyVector2(strPropertyName, objectValue);
            }

            return false;
        }
Пример #24
0
 public abstract bool SetPropertyVector2(string strPropertyName, NFVector2 obj);
Пример #25
0
 public abstract bool SetRecordVector2(string strRecordName, int nRow, int nCol, NFVector2 obj);
Пример #26
0
 public static float Distance(NFVector2 va, NFVector2 vb)
 {
     NFVector2 vector = NFVector2.sub(va, vb);
     return vector.Length();
 }
Пример #27
0
            public bool Set(NFVector2 value)
            {
                if (nType == VARIANT_TYPE.VTYPE_VECTOR2)
                {
                    mData = value;
                    return true;
                }

                return false;
            }
Пример #28
0
        public override bool SetRecordVector2(string strRecordName, int nRow, int nCol, NFVector2 obj)
        {
            NFIRecord record = mRecordManager.GetRecord(strRecordName);
            if (null != record)
            {
                record.SetVector2(nRow, nCol, obj);
                return true;
            }

            return false;
        }
Пример #29
0
        public override bool SetPropertyVector2(string strPropertyName, NFVector2 obj)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);
            if (null == property)
            {
                NFIDataList valueList = new NFCDataList();
                valueList.AddVector2(new NFVector2());
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetVector2(obj);
            return true;

        }
Пример #30
0
        public override bool SetVector2(NFVector2 value)
        {
            if (mxData.Vector2Val() != value)
            {
                NFIDataList.TData oldValue = new NFIDataList.TData(mxData);
                NFIDataList.TData newValue = new NFIDataList.TData(NFIDataList.VARIANT_TYPE.VTYPE_VECTOR2);
                newValue.Set(value);

                mxData.Set(value);

                if (null != doHandleDel)
                {
                    doHandleDel(mSelf, msPropertyName, oldValue, newValue);
                }
            }

            return true;
        }
Пример #31
0
        public override bool AddVector2(NFVector2 value)
        {
            TData data = new TData(VARIANT_TYPE.VTYPE_VECTOR2);
            data.Set(value);

            return AddDataObject(ref data);
        }
Пример #32
0
 public abstract bool SetVector2(int nRow, int nCol, NFVector2 value);
Пример #33
0
        public override int FindRecordRow(NFGUID self, string strRecordName, int nCol, NFVector2 nValue)
        {
            NFDataList datalist = new NFDataList();
            int        nCount   = FindRecordRow(self, strRecordName, nCol, nValue, ref datalist);

            if (nCount > 0 && datalist.Count() > 0)
            {
                return((int)datalist.IntVal(0));
            }
            return(-1);
        }
Пример #34
0
 public abstract bool SetVector2(int nRow, int nCol, NFVector2 value);
Пример #35
0
        public override bool SetRecordVector2(string strRecordName, int nRow, int nCol, NFVector2 obj)
        {
            NFIRecord record = mRecordManager.GetRecord(strRecordName);

            if (null != record)
            {
                record.SetVector2(nRow, nCol, obj);
                return(true);
            }

            return(false);
        }
Пример #36
0
    static public NFMsg.Vector2 NFToPB(NFVector2 value)
    {
        NFMsg.Vector2 vector = new NFMsg.Vector2();
        vector.x = value.X();
        vector.y = value.Y();

        return vector;
    }
Пример #37
0
        public override bool SetRecordVector2(NFGUID self, string strRecordName, int nRow, int nCol, NFVector2 objectValue)
        {
            if (mhtObject.ContainsKey(self))
            {
                NFIObject xGameObject = (NFIObject)mhtObject[self];
                return xGameObject.SetRecordVector2(strRecordName, nRow, nCol, objectValue);
            }

            return false;
        }
Пример #38
0
 public abstract bool SetPropertyVector2(NFGUID self, string strPropertyName, NFVector2 objectValue);
Пример #39
0
 public abstract int FindVector2(int nCol, NFVector2 value, ref NFIDataList varResult);
Пример #40
0
 public abstract int FindRecordRow(NFGUID self, string strRecordName, int nCol, NFVector2 nValue);
Пример #41
0
 public abstract int FindVector2(int nCol, NFVector2 value, ref NFIDataList varResult);
Пример #42
0
 public abstract bool SetVector2(NFVector2 value);
Пример #43
0
 public abstract int FindRecordRow(NFGUID self, string strRecordName, int nCol, NFVector2 nValue, ref NFIDataList xDatalist);
Пример #44
0
 public abstract bool SetRecordVector2(string strRecordName, int nRow, int nCol, NFVector2 obj);
Пример #45
0
 public abstract bool SetRecordVector2(NFGUID self, string strRecordName, int nRow, int nCol, NFVector2 objectValue);
Пример #46
0
 public abstract bool SetRecordVector2(NFGUID self, string strRecordName, int nRow, int nCol, NFVector2 objectValue);
Пример #47
0
 public abstract bool AddVector2(NFVector2 value);
Пример #48
0
        public override bool SetRecordVector2(NFGUID self, string strRecordName, int nRow, int nCol, NFVector2 objectValue)
        {
            if (mhtObject.ContainsKey(self))
            {
                NFIObject xGameObject = (NFIObject)mhtObject[self];
                return(xGameObject.SetRecordVector2(strRecordName, nRow, nCol, objectValue));
            }

            return(false);
        }
Пример #49
0
        public override int FindVector2(int nCol, NFVector2 value, ref NFIDataList varResult)
        {
            foreach (int i in mhtRecordVec.Keys)
            {
                NFIDataList valueList = (NFIDataList)mhtRecordVec[i];
                if (valueList.Vector2Val(nCol) == value)
                {
                    varResult.AddInt(i);
                }
            }

            return varResult.Count();
        }
Пример #50
0
        public override int FindRecordRow(NFGUID self, string strRecordName, int nCol, NFVector2 nValue, ref NFDataList xDatalist)
        {
            if (mhtObject.ContainsKey(self))
            {
                NFIObject        xGameObject = (NFIObject)mhtObject[self];
                NFrame.NFIRecord xRecord     = xGameObject.GetRecordManager().GetRecord(strRecordName);
                if (null != xRecord)
                {
                    return(xRecord.FindVector2(nCol, nValue, ref xDatalist));
                }
            }

            return(-1);
        }
Пример #51
0
 public abstract bool SetPropertyVector2(string strPropertyName, NFVector2 obj);
Пример #52
0
        public override bool SetVector2(int index, NFVector2 value)
        {
            TData data = GetData(index);
            if (data != null && data.GetType() == VARIANT_TYPE.VTYPE_VECTOR2)
            {
                data.Set(value);

                return true;
            }

            return false;
        }
Пример #53
0
 public abstract bool SetVector2(NFVector2 value);
Пример #54
0
 public abstract bool SetPropertyVector2(NFGUID self, string strPropertyName, NFVector2 objectValue);