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); }
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; }
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); }
public bool AddVector2(NFVector2 value) { TData data = new TData(VARIANT_TYPE.VTYPE_VECTOR2); data.Set(value); return(AddDataObject(ref data)); }
static public NFMsg.Vector2 NFToPB(NFVector2 value) { NFMsg.Vector2 vector = new NFMsg.Vector2(); vector.x = value.X(); vector.y = value.Y(); return(vector); }
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); }
public NFMsg.Vector2 NFToPB(NFVector2 value) { NFMsg.Vector2 vector = new NFMsg.Vector2(); vector.X = value.X(); vector.Y = value.Y(); return(vector); }
static public NFVector2 PBToNF(NFMsg.Vector2 value) { NFVector2 vector = new NFVector2(); vector.SetX(value.x); vector.SetY(value.y); return(vector); }
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); }
public bool Set(NFVector2 value) { if (nType == VARIANT_TYPE.VTYPE_VECTOR2) { mData = value; return(true); } return(false); }
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); }
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); }
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()); }
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); }
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); }
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); }
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); } } } } }
public abstract int FindRecordRow(NFGUID self, string strRecordName, int nCol, NFVector2 nValue, ref NFIDataList xDatalist);
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; }
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; }
public abstract bool SetVector2(int index, NFVector2 value);
public static float Distance(NFVector2 va, NFVector2 vb) { NFVector2 vector = NFVector2.sub(va, vb); return(vector.Length()); }
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; }
public abstract bool SetPropertyVector2(string strPropertyName, NFVector2 obj);
public abstract bool SetRecordVector2(string strRecordName, int nRow, int nCol, NFVector2 obj);
public static float Distance(NFVector2 va, NFVector2 vb) { NFVector2 vector = NFVector2.sub(va, vb); return vector.Length(); }
public bool Set(NFVector2 value) { if (nType == VARIANT_TYPE.VTYPE_VECTOR2) { mData = value; return true; } return false; }
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; }
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; }
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; }
public override bool AddVector2(NFVector2 value) { TData data = new TData(VARIANT_TYPE.VTYPE_VECTOR2); data.Set(value); return AddDataObject(ref data); }
public abstract bool SetVector2(int nRow, int nCol, NFVector2 value);
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); }
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); }
static public NFMsg.Vector2 NFToPB(NFVector2 value) { NFMsg.Vector2 vector = new NFMsg.Vector2(); vector.x = value.X(); vector.y = value.Y(); return vector; }
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; }
public abstract bool SetPropertyVector2(NFGUID self, string strPropertyName, NFVector2 objectValue);
public abstract int FindVector2(int nCol, NFVector2 value, ref NFIDataList varResult);
public abstract int FindRecordRow(NFGUID self, string strRecordName, int nCol, NFVector2 nValue);
public abstract bool SetVector2(NFVector2 value);
public abstract bool SetRecordVector2(NFGUID self, string strRecordName, int nRow, int nCol, NFVector2 objectValue);
public abstract bool AddVector2(NFVector2 value);
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); }
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(); }
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); }
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; }