private void OnPropertyVector2(UInt16 id, MemoryStream stream) { NFMsg.MsgBase xMsg = new NFMsg.MsgBase(); xMsg = Serializer.Deserialize <NFMsg.MsgBase>(stream); NFMsg.ObjectPropertyVector2 propertyData = new NFMsg.ObjectPropertyVector2(); propertyData = Serializer.Deserialize <NFMsg.ObjectPropertyVector2>(new MemoryStream(xMsg.msg_data)); NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(propertyData.player_id)); for (int i = 0; i < propertyData.property_list.Count; i++) { NFIPropertyManager propertyManager = go.GetPropertyManager(); NFIProperty property = propertyManager.GetProperty(System.Text.Encoding.Default.GetString(propertyData.property_list[i].property_name)); if (null == property) { NFDataList varList = new NFDataList(); varList.AddVector2(new NFVector2()); property = propertyManager.AddProperty(System.Text.Encoding.Default.GetString(propertyData.property_list[i].property_name), varList); } property.SetVector2(mHelpModule.PBToNF(propertyData.property_list[i].data)); } }
public override bool SetPropertyVector2(string strPropertyName, NFVector2 obj) { NFIProperty property = mPropertyManager.GetProperty(strPropertyName); if (null == property) { NFDataList.TData xValue = new NFDataList.TData(NFDataList.VARIANT_TYPE.VTYPE_VECTOR2); property = mPropertyManager.AddProperty(strPropertyName, xValue); } property.SetVector2(obj); return(true); }
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); }
private void OnPropertyVector2(UInt16 id, MemoryStream stream) { NFMsg.MsgBase xMsg = NFMsg.MsgBase.Parser.ParseFrom(stream); NFMsg.ObjectPropertyVector2 propertyData = NFMsg.ObjectPropertyVector2.Parser.ParseFrom(xMsg.msg_data); NFIObject go = mKernelModule.GetObject(mHelpModule.PBToNF(propertyData.player_id)); for (int i = 0; i < propertyData.property_list.Count; i++) { NFIPropertyManager propertyManager = go.GetPropertyManager(); NFIProperty property = propertyManager.GetProperty(propertyData.property_list[i].property_name.ToStringUtf8()); if (null == property) { NFDataList varList = new NFDataList(); varList.AddVector2(new NFVector2()); property = propertyManager.AddProperty(propertyData.property_list[i].property_name.ToStringUtf8(), varList); } property.SetVector2(mHelpModule.PBToNF(propertyData.property_list[i].data)); } }