Exemplo n.º 1
0
        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));
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        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));
            }
        }