Beispiel #1
0
 protected override void GetData(SerializeData data)
 {
     data.SetValue("Grantee", Grantee);
     data.SetValue("Privileges", (int)Privileges);
     data.SetValue("ObjectName", ObjectName);
     data.SetValue("GrantOption", GrantOption);
 }
Beispiel #2
0
 public static Vector3 GetPosition(string name)
 {
     if (name == null)
     {
         Debug.LogError("[FduClusterInput]Tracker name can not be null");
         return(Vector3.zero);
     }
     if (!_instance._trackerMap.ContainsKey(name))
     {
         if (_instance.isMaster)
         {
             SerializeData _data = new SerializeData();
             _data.name = name;
             _data.type = FduClusterInputType.Tracker;
             TrackerData tData = new TrackerData();
             tData.reset();
             _instance._sendList.Add(_data);
             _instance._trackerMap.Add_overlay(name, tData);
         }
         return(Vector3.zero);
     }
     else
     {
         return(_instance._trackerMap[name].getPosValue());
     }
 }
Beispiel #3
0
 public static void SetQuaternion(string name, Quaternion value)
 {
     if (name == null)
     {
         Debug.LogError("[FduClusterInput]Tracker name can not be null");
         return;
     }
     if (!_instance.isMaster)
     {
         return;
     }
     if (!_instance._trackerMap.ContainsKey(name))
     {
         if (_instance.isMaster)
         {
             SerializeData _data = new SerializeData();
             _data.name = name;
             _data.type = FduClusterInputType.Tracker;
             TrackerData tData = new TrackerData();
             tData.reset();
             tData.setRotValue(value);
             _instance._sendList.Add(_data);
             _instance._trackerMap.Add_overlay(name, tData);
         }
     }
     else
     {
         _instance._trackerMap[name].setRotValue(value);
     }
 }
Beispiel #4
0
        public static void SetButton(string name, bool value)
        {
            if (name == null)
            {
                Debug.LogError("[FduClusterInput]Button name can not be null");
                return;
            }
            if (!_instance.isMaster)
            {
                return;
            }
            if (!_instance._buttonMap.ContainsKey(name))
            {
                _instance.kmCollector.addButtonName(name);

                SerializeData _data = new SerializeData();
                _data.name = name;
                _data.type = FduClusterInputType.Button;
                ButtonData bData = new ButtonData();
                bData.reset();
                bData.setValue(value);
                _instance._sendList.Add(_data);
                _instance._buttonMap.Add_overlay(name, bData);
                return;
            }
            else
            {
                _instance._buttonMap[name].setValue(value);
            }
        }
Beispiel #5
0
        public static void SetAxis(string name, float value)
        {
            if (name == null)
            {
                Debug.LogError("[FduClusterInput]Axis name can not be null");
                return;
            }
            if (!_instance.isMaster)
            {
                return;
            }
            if (!_instance._axisMap.ContainsKey(name))
            {
                _instance.kmCollector.addAxisName(name);

                SerializeData _data = new SerializeData();
                _data.name = name;
                _data.type = FduClusterInputType.Axis;
                AxisData aData = new AxisData();
                aData.reset();
                aData.setValue(value);
                _instance._sendList.Add(_data);
                _instance._axisMap.Add_overlay(name, aData);
            }
            else
            {
                _instance._axisMap[name].setValue(value);
            }
        }
 protected override void GetData(SerializeData data)
 {
     data.SetValue("IsForTable", IsForTable);
     data.SetValue("QueryPlan", QueryPlan);
     data.SetValue("Table", Table);
     data.SetValue("VariableName", VariableName);
 }
    public int Serialize(SerializeData data)
    {
        switch (data.ghostType)
        {
        case 0:
        {
            return(GhostSendSystem <DotsSampleGhostSerializerCollection> .InvokeSerialize <PlayerStateGhostSerializer, PlayerStateSnapshotData>(m_PlayerStateGhostSerializer, data));
        }

        case 1:
        {
            return(GhostSendSystem <DotsSampleGhostSerializerCollection> .InvokeSerialize <Char_TerraformerGhostSerializer, Char_TerraformerSnapshotData>(m_Char_TerraformerGhostSerializer, data));
        }

        case 2:
        {
            return(GhostSendSystem <DotsSampleGhostSerializerCollection> .InvokeSerialize <Weapon_TerraformerGhostSerializer, Weapon_TerraformerSnapshotData>(m_Weapon_TerraformerGhostSerializer, data));
        }

        case 3:
        {
            return(GhostSendSystem <DotsSampleGhostSerializerCollection> .InvokeSerialize <GameModeGhostSerializer, GameModeSnapshotData>(m_GameModeGhostSerializer, data));
        }

        case 4:
        {
            return(GhostSendSystem <DotsSampleGhostSerializerCollection> .InvokeSerialize <TeleporterGhostSerializer, TeleporterSnapshotData>(m_TeleporterGhostSerializer, data));
        }

        default:
            throw new ArgumentException("Invalid serializer type");
        }
    }
 static Configuration()
 {
     if (File.Exists(NamesManage.ConfigFileName))
     {
         instance = SerializeData <Configuration> .T_ReadBinary(NamesManage.ConfigFileName);
     }
 }
        public override void DoubleClick(Action <string> showMsg)
        {
            base.Itemvms.Clear();
            Tuple <DataSet, string> tp = AccessAndExcelOp.GetDataFromExcelByConn(NamesManage.VoltTbName, NamesManage.CptTbName, NamesManage.TBTbName);

            if (tp != null)
            {
                ComponentConfigDao dao = new ComponentConfigDao();//元件配置表实体转换类
                /*电压给定表*/
                DataTable table = tp.Item1.Tables[NamesManage.VoltTbName];
                config.Vsets = dao.getVccConfig(table);
                showMsg(String.Format("加载电压给定表{0}条。\r\n", config.Vsets.Count));
                base.Itemvms.Add(new VoltDisplay(this));
                /*元件配置表*/
                table         = tp.Item1.Tables[NamesManage.CptTbName];
                config.Cptlib = dao.getComponentInfo(table);
                showMsg(String.Format("加载元件名称表{0}条。\r\n", config.Cptlib.Count));
                base.Itemvms.Add(new CptDisplay(this));
                /*端子排短接表*/
                table        = tp.Item1.Tables[NamesManage.TBTbName];
                config.Tblib = dao.getTermialRelations(table);
                showMsg(String.Format("加载端子排短接表{0}条。\r\n", config.Tblib.Count));
                base.Itemvms.Add(new TBDisplay(this));
            }
            /*保存本地*/
            try
            {
                SerializeData <Configuration> .T_WriteBinary(Configuration.GetInstance(), NamesManage.ConfigFileName);
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show(ex.Message);
            }
        }
        public Track DuplicateTrack(Track srcTrack, bool includeKeys)
        {
            var dupTrack = SerializeData.CreateTrack(srcTrack.serializeType);

            srcTrack.CopyTo(dupTrack);

            dupTrack.maintainTrack(mDataTarget);

            Object tgtObj = dupTrack.GetTarget(mDataTarget);

            //if there's no target, then we can't add the keys for events and properties
            if (includeKeys && !(tgtObj == null && (dupTrack is PropertyTrack || dupTrack is EventTrack)))
            {
                foreach (var key in srcTrack.keys)
                {
                    var dupKey = SerializeData.CreateKey(key.serializeType);
                    if (dupKey != null)
                    {
                        key.CopyTo(dupKey);
                        dupKey.maintainKey(mDataTarget, tgtObj);
                        dupTrack.keys.Add(dupKey);
                    }
                }

                dupTrack.updateCache(mDataTarget);
            }

            return(dupTrack);
        }
Beispiel #11
0
 void ISerializable.GetData(SerializeData data)
 {
     data.SetValue("Table", TableName);
     data.SetValue("SubQuery", SubQuery);
     data.SetValue("JoinType", (int)JoinType);
     data.SetValue("On", OnExpression);
 }
        /// <summary>
        /// 終了処理
        /// </summary>
        public void Terminate()
        {
            //トーナメントグループの削除
            foreach (var iControl in mTournamentGroupControlList)
            {
                ContentGrid.Children.Remove(iControl);
            }
            mTournamentGroupControlList.Clear();

            //決着トーナメントラインを削除
            foreach (var iLine in mLastLineList)
            {
                ContentGrid.Children.Remove(iLine);
            }
            mLastLineList.Clear();

            //状態保存
            var serial_Data = new SerializeData();

            serial_Data.mDiplayToolWindowFlg = (BattleOptionItem.IsChecked == true);
            serial_Data.mDisplayScrollbarFlg = (ScrollbarItem.IsChecked == true);
            DataManager.GetInstance().SetData(mContentKey, serial_Data);

            //ツールウィンドウを閉じる
            CloseToolWindow();
        }
Beispiel #13
0
        private SerializeInfo WriteSerializer(SerializeData Data, Type Type)
        {
            var Sr = SerializeInfo.GetSerialize(Type);

            VisitedInfoSerialize <object>(Data, Sr.Type, () => (Sr.NameAsByte, null));
            return(Sr);
        }
Beispiel #14
0
 void ISerializable.GetData(SerializeData data)
 {
     if (value != null)
     {
         data.SetValue("Value", value.Value);
     }
 }
Beispiel #15
0
    public int Serialize(ref DataStreamWriter dataStream, SerializeData data)
    {
        switch (data.ghostType)
        {
        case 0:
        {
            return(GhostSendSystem <UnityGroceryGhostSerializerCollection> .InvokeSerialize <Char_CapsuleGhostSerializer, Char_CapsuleSnapshotData>(m_Char_CapsuleGhostSerializer, ref dataStream, data));
        }

        case 1:
        {
            return(GhostSendSystem <UnityGroceryGhostSerializerCollection> .InvokeSerialize <PlayerStateGhostSerializer, PlayerStateSnapshotData>(m_PlayerStateGhostSerializer, ref dataStream, data));
        }

        case 2:
        {
            return(GhostSendSystem <UnityGroceryGhostSerializerCollection> .InvokeSerialize <GameModeGhostSerializer, GameModeSnapshotData>(m_GameModeGhostSerializer, ref dataStream, data));
        }

        case 3:
        {
            return(GhostSendSystem <UnityGroceryGhostSerializerCollection> .InvokeSerialize <Char_BanditGhostSerializer, Char_BanditSnapshotData>(m_Char_BanditGhostSerializer, ref dataStream, data));
        }

        default:
            throw new ArgumentException("Invalid serializer type");
        }
    }
Beispiel #16
0
    public static string Data_ToString(SerializeData data)
    {
        StringBuilder str = new StringBuilder();
        string name = data.property["Name"];
        str.AppendFormat("<{0} ", name);
        data.property.Remove("Name");
        foreach (var item in data.property)
        {
            str.AppendFormat("{0}=\"{1}\" ", item.Key, item.Value);
        }
        if (string.IsNullOrEmpty(data.childs_self))
        {
            str.Append("/>\r\n");
        }
        else
        {
            str.AppendFormat(">\r\n{0}</{1}>\r\n", data.childs_self, name);
        }

        foreach (var item in data.childs)
        {
            for (int i = 0; i < item.Value.Count; i++)
            {
                str.Append(Data_ToString(item.Value[i]));
            }
        }
        return str.ToString();
    }
 protected override void GetData(SerializeData data)
 {
     data.SetValue("Name", ViewName);
     data.SetValue("QueryPlan", QueryPlan);
     data.SetValue("QueryExpression", QueryExpression);
     data.SetValue("ReplaceIfExists", ReplaceIfExists);
 }
Beispiel #18
0
 protected override void GetData(SerializeData data)
 {
     data.SetValue("Columns", ColumnNames);
     data.SetValue("GroupMax", GroupMaxColumn);
     data.SetValue("Functions", Functions);
     data.SetValue("Names", Names);
 }
Beispiel #19
0
        public virtual void WriteObject(SerializeData staticSerializeData, object value)
        {
            if (!staticSerializeData.UseObjectInfo || !base.UseObjectInfos)
            {
                staticSerializeData.Write(this, value);
                return;
            }
            if (value == null)
            {
                WriteObjectInfo(0, isReference: true, null);
                return;
            }
            if (m_idByObject.TryGetValue(value, out int value2))
            {
                WriteObjectInfo(value2, isReference: true, null);
                return;
            }
            value2 = m_nextObjectId++;
            m_idByObject.Add(value, value2);
            Type type = value.GetType();

            if (type == staticSerializeData.Type)
            {
                WriteObjectInfo(value2, isReference: false, null);
                staticSerializeData.Write(this, value);
            }
            else
            {
                SerializeData serializeData = Archive.GetSerializeData(type, allowEmptySerializer: false);
                WriteObjectInfo(value2, isReference: false, type);
                serializeData.Write(this, value);
            }
        }
 public override void SerializeDictionary <K, V>(string name, IDictionary <K, V> dictionary)
 {
     EnterNode(name);
     if (typeof(K) == typeof(string))
     {
         SerializeData serializeData = Archive.GetSerializeData(typeof(V), allowEmptySerializer: true);
         foreach (KeyValuePair <K, V> item in dictionary)
         {
             string name2 = item.Key as string;
             EnterNode(name2);
             WriteObject(null, serializeData, item.Value);
             LeaveNode(name2);
         }
     }
     else
     {
         SerializeData serializeData2 = Archive.GetSerializeData(typeof(K), allowEmptySerializer: true);
         SerializeData serializeData3 = Archive.GetSerializeData(typeof(V), allowEmptySerializer: true);
         foreach (KeyValuePair <K, V> item2 in dictionary)
         {
             EnterNode("e");
             WriteObject("k", serializeData2, item2.Key);
             WriteObject("v", serializeData3, item2.Value);
             LeaveNode("e");
         }
     }
     LeaveNode(name);
 }
        public override void DoubleClick(Action <string> showMsg)
        {
            Tuple <DataSet, string> tp = AccessAndExcelOp.GetDataFromExcelByConn(NamesManage.ConTactorTbName, NamesManage.RelayTbName, NamesManage.IndicatorTbName);

            if (tp != null)
            {
                TerminalRelationsDao dao = new TerminalRelationsDao();//Table到实体类的映射工具
                /*接触器库*/
                DataTable table = tp.Item1.Tables[NamesManage.ConTactorTbName];
                config.ContactorPins = dao.getRelayPins(table);
                showMsg(String.Format("加载接触器端子信息{0}条。\r\n", config.ContactorPins.Count));
                base.Itemvms.Add(new ConTactorLibDisplay(this));
                /*继电器库*/
                table            = tp.Item1.Tables[NamesManage.RelayTbName];
                config.RelayPins = dao.getRelayPins(table);
                showMsg(String.Format("加载继电器端子信息{0}条。\r\n", config.RelayPins.Count));
                base.Itemvms.Add(new RelayLibDisplay(this));
                /*指示灯模块库*/
                table = tp.Item1.Tables[NamesManage.IndicatorTbName];
                config.IndicatorPins = dao.getIndicatorPins(table);
                showMsg(String.Format("加载指示灯模块端子信息{0}条。\r\n", config.IndicatorPins.Count));
                base.Itemvms.Add(new IndicatorLibDisplay(this));
                /*保存本地*/
                SerializeData <Configuration> .T_WriteBinary(config, NamesManage.ConfigFileName);
            }
        }
Beispiel #22
0
        void ISerializable.GetData(SerializeData data)
        {
            data.SetValue("SourceQuery", SourceQuery);
            data.SetValue("IsFromQuery", IsFromQuery);

            GetData(data);
        }
Beispiel #23
0
 protected override void GetData(SerializeData data)
 {
     data.SetValue("TableName", TableName);
     data.SetValue("QueryPlan", QueryPlan);
     data.SetValue("Columns", Columns);
     data.SetValue("Limit", Limit);
 }
 void Update()
 {
     if (coll == null)
     {
         coll = SerializeData.loadJsonitem();
     }
 }
 protected override void GetData(SerializeData data)
 {
     data.SetValue("TableName", TableName);
     data.SetValue("QueryPlan", QueryPlan);
     data.SetValue("ColumnNames", ColumnNames);
     data.SetValue("ColumnIndices", ColumnIndices);
 }
Beispiel #26
0
 void ISerializable.GetData(SerializeData data)
 {
     data.SetValue("Name", Name);
     data.SetValue("Type", SqlType);
     data.SetValue("Direction", Direction);
     data.SetValue("Value", Value);
 }
Beispiel #27
0
        public static SerializeData CreateSerializeDataForSerializableHelper <T>() where T : ISerializable
        {
            SerializeData serializeData = CreateEmptySerializeData(typeof(T));

            if (typeof(T).GetTypeInfo().IsValueType)
            {
                serializeData.Read = delegate(InputArchive archive, ref object value)
                {
                    T val = (T)value;
                    val.Serialize(archive);
                    value = val;
                };
            }
            else
            {
                serializeData.Read = delegate(InputArchive archive, ref object value)
                {
                    ((T)value).Serialize(archive);
                };
            }
            serializeData.Write = delegate(OutputArchive archive, object value)
            {
                ((T)value).Serialize(archive);
            };
            serializeData.AutoConstructObject = true;
            return(serializeData);
        }
Beispiel #28
0
        public void LoadPackageFromFile(string filePath)
        {
            if (string.IsNullOrEmpty(filePath))
            {
                return;
            }

            object data = SerializeHelper.DeserializeBinary(filePath);

            if (data == null)
            {
                Log.w("#Failed Deserialize");
                return;
            }

            SerializeData sd = data as SerializeData;

            if (sd == null)
            {
                Log.e("#Failed Load AssetDataTable:" + filePath);
                return;
            }

            for (int i = 0; i < sd.datas.Length; i++)
            {
                AssetDataPackage package = BuildAssetDataPackageBySerializeData(sd.datas[i], filePath);
                string           key     = package.key;
                m_AllAssetDataMap.Add(key, package);
                m_AllAssetDataPackage.Add(package);
            }
        }
 //Check login
 public List <DL_LoginReturn> CheckLogin(DL_Login login)
 {
     this.SpName = DL_StoreProcedure.SP_DHS_API_Login; //Sp Name
     _IsSuccess  = true;
     try
     {
         SqlParameter[] param = new SqlParameter[4];
         param[0] = new SqlParameter("@UserName", login.Mobile);
         param[1] = new SqlParameter("@Password", login.Pass);
         param[2] = new SqlParameter("@Version", login.Version);
         param[3] = new SqlParameter("@Key", GenerateRandomSession());
         ds       = db.GetDataSet(this.SpName, param);
         if (ds != null && ds.Tables.Count > 0)
         {
             Logger.WriteLog(LogLevelL4N.INFO, "Got Data from Db.");
             loginReturn = new List <DL_LoginReturn>();
             //  var Json = JsonConvert.SerializeObject(ds);
             //loginReturn = JsonConvert.DeserializeObject<DL_LoginReturn>(Json);
             loginReturn = SerializeData.SerializeMultiValue <DL_LoginReturn>(ds.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         Logger.WriteLog(LogLevelL4N.ERROR, "Exeception : " + ex.Message);
         _IsSuccess = false;
     }
     return(loginReturn);
 }
Beispiel #30
0
        void ISerializable.GetData(SerializeData data)
        {
            data.SetValue("Left", Left);
            data.SetValue("Right", Right);

            GetData(data);
        }
Beispiel #31
0
        internal protected XmlElement CreateXmlForSave(XmlDocument xmlDoc, string subRootName)
        {
            XmlElement node;

            XmlElement   rootNode = xmlDoc.CreateElement(subRootName);
            XmlAttribute guid     = xmlDoc.CreateAttribute("GUID");

            guid.Value = Guid;
            rootNode.SetAttributeNode(guid);

            Dictionary <String, PropertyInfo> propSaveLoad = new Dictionary <String, PropertyInfo>();

            foreach (PropertyInfo prop in (this.GetType()).GetProperties())
            {
                foreach (object attribute in prop.GetCustomAttributes(true))
                {
                    if (attribute is SaveLoadAttribute)
                    {
                        if (string.IsNullOrEmpty(attribute.ToString()))
                        {
                            propSaveLoad.Add(prop.Name, prop);
                        }
                        else
                        {
                            propSaveLoad.Add(attribute.ToString(), prop);
                        }
                    }
                }
            }

            foreach (string nodeName in propSaveLoad.Keys)
            {
                PropertyInfo thisProp = propSaveLoad[nodeName];
                if (thisProp != null)
                {
                    object value = thisProp.GetValue(this, null);
                    if (SerializeData.Serialize(thisProp.PropertyType, value, out string valueText))
                    {
                        node = xmlDoc.CreateElement(nodeName);
                        node.AppendChild(xmlDoc.CreateTextNode(valueText));
                        rootNode.AppendChild(node);
                    }
                    else
                    {
                        if (valueText != null)
                        {
                            throw new Exception(valueText);
                        }
                        else
                        {
                            throw new Exception("in '" + thisProp.Name + "' ,Can not determine type ");
                        }
                    }
                }
            }

            InternalCreateXmlForSave(rootNode);

            return(rootNode);
        }
Beispiel #32
0
        public Scene(MpqFile file)
        {
            var stream = file.Open();

            long pos = 0; // x
            DEADBEEF = stream.ReadInt32();
            snoType = stream.ReadInt32();
            unknown1 = stream.ReadInt32();
            unknown2 = stream.ReadInt32();
            SceneSNO = stream.ReadInt32();
            unknown3 = stream.ReadInt32();
            unknown4 = stream.ReadInt32();
            i0 = stream.ReadInt32();
            aabbBounds = new AABB(stream);
            aabbMarkerSetBounds = new AABB(stream);

            //load NavMeshDef
            NavMesh = new NavMeshDef(stream);
            // end navmeshdef
            var serExclusions = new SerializeData(stream);
            stream.Position += 56;
            var serInclusions = new SerializeData(stream);
            stream.Position += 56;

            //MarkerSet Time
            var serMarkerSets = new SerializeData(stream);
            pos = stream.Position;
            stream.Position = serMarkerSets.Offset + 16;
            MarkerSets = new int[serMarkerSets.Size/4];
            for (int i = 0; i < serMarkerSets.Size/4; i++)
            {
                MarkerSets[i] = stream.ReadInt32();
            }
            stream.Position = pos + 56;

            //TODO - parse LookLink /dark
            LookLink = new char[64];
            for (int i = 0; i < 64; i++)
            {
                LookLink[i] = (char) stream.ReadByte();
            }

            var sermsgTriggeredEvents = new SerializeData(stream);
            int i1 = stream.ReadInt32();
            stream.Position += 12;

            //navzonedef
            NavZone = new NavZoneDef(stream);

            stream.Close();
        }
Beispiel #33
0
        // Updated based on BoyC's 010editoer template, looks like some data at the end still isnt parsed - Darklotus
        public Actor(MpqFile file)
        {
            var stream = file.Open();
            stream.Seek(16, SeekOrigin.Begin);
            this.ActorSNO = stream.ReadInt32();
            stream.Position += 8; // pad 2;
            this.i0 = stream.ReadInt32();
            this.Type = stream.ReadInt32();
            this.ApperanceSNO = stream.ReadInt32();
            this.snoPhysMesh = stream.ReadInt32();
            this.Cyl = new AxialCylinder(stream);
            this.s = new Sphere(stream);
            this.aabbBounds = new AABB(stream);
            this.serTagMap = new SerializeData(stream);
            stream.Position += 8; // pad 2
            this.AnimSetSNO = stream.ReadInt32();
            this.MonsterSNO = stream.ReadInt32();
            this.serMsgTriggeredEvents = new SerializeData(stream);

            this.i1 = stream.ReadInt32();
            stream.Position += 12; // pad 3 int - DarkLotus
            this.v0 = new Vector3D(stream.ReadFloat(), stream.ReadFloat(), stream.ReadFloat());
            this.Looks = new WeightedLook[8];
            for (int i = 0; i < 8; i++)
            {
                this.Looks[i] = new WeightedLook(stream);
            }
            this.PhysicsSNO = stream.ReadInt32();
            this.i2 = stream.ReadInt32(); this.i3 = stream.ReadInt32();
            this.f0 = stream.ReadFloat(); this.f1 = stream.ReadFloat(); this.f2 = stream.ReadFloat();
            this.padActorCollisionData = new int[17]; // Was 68/4 - Darklotus 
            for (int i = 0; i < 17; i++)
            {
                this.padActorCollisionData[i] = stream.ReadInt32();
            }
            this.padInventoryImages = new int[10]; //Was 5*8/4 - Darklotus
            for (int i = 0; i < 10; i++)
            {
                this.padInventoryImages[i] = stream.ReadInt32();
            }
            stream.Close();
        }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     serVertices = new SerializeData();
     serVertices.Parse(buffer);
     Field2 = new DT_VARIABLEARRAY();
     Field2.Parse(buffer);
     Field3 = buffer.ReadInt(32);
     serTriangles = new SerializeData();
     serTriangles.Parse(buffer);
     Field5 = new DT_VARIABLEARRAY();
     Field5.Parse(buffer);
     Field6 = buffer.ReadInt(32);
     serPlanes = new SerializeData();
     serPlanes.Parse(buffer);
     Field8 = new DT_VARIABLEARRAY();
     Field8.Parse(buffer);
     Field9 = new Matrix3x3();
     Field9.Parse(buffer);
     Field10 = new Vector3D();
     Field10.Parse(buffer);
     Field11 = buffer.ReadFloat32();
     Field12 = buffer.ReadFloat32();
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     snoCloth = buffer.ReadInt(32);
     serTagMap = new SerializeData();
     serTagMap.Parse(buffer);
     hTagMap = new DT_TAGMAP();
     hTagMap.Parse(buffer);
     Field4 = new UberMaterial();
     Field4.Parse(buffer);
     snoMaterial = buffer.ReadInt(32);
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     Field1 = buffer.ReadInt(32);
     Field2 = buffer.ReadFloat32();
     Field3 = buffer.ReadFloat32();
     Field4 = buffer.ReadFloat32();
     Field5 = buffer.ReadInt(32);
     Field6 = buffer.ReadFloat32();
     Field7 = buffer.ReadFloat32();
     Field8 = buffer.ReadFloat32();
     Field9 = buffer.ReadFloat32();
     Field10 = buffer.ReadFloat32();
     Field11 = buffer.ReadFloat32();
     Field12 = buffer.ReadFloat32();
     serPermutations = new SerializeData();
     serPermutations.Parse(buffer);
     Field14 = buffer.ReadInt(32);
     Field15 = new DT_VARIABLEARRAY();
     Field15.Parse(buffer);
     Field16 = buffer.ReadInt(32);
     Field17 = buffer.ReadInt(32);
     Field18 = new DT_VARIABLEARRAY();
     Field18.Parse(buffer);
     serDspEffects = new SerializeData();
     serDspEffects.Parse(buffer);
     Field20 = buffer.ReadInt(32);
 }
 public void Parse(GameBitBuffer buffer)
 {
     dwFlags = buffer.ReadInt(32);
     nBoneCount = buffer.ReadInt(32);
     serBoneStructure = new SerializeData();
     serBoneStructure.Parse(buffer);
     Field3 = new DT_VARIABLEARRAY();
     Field3.Parse(buffer);
     Field4 = new LookAtData();
     Field4.Parse(buffer);
     Field5 = buffer.ReadInt(32);
     Field6 = new DT_VARIABLEARRAY();
     Field6.Parse(buffer);
     serBonePulses = new SerializeData();
     serBonePulses.Parse(buffer);
     Field8 = new GeoSet[2];
     for(int i = 0;i < _Field8.Length;i++)
     {
         _Field8[i] = new GeoSet();
         _Field8[i].Parse(buffer);
     }
     Field9 = new Sphere();
     Field9.Parse(buffer);
     nCollisionCapsuleCount = buffer.ReadInt(32);
     serCollisionCapsules = new SerializeData();
     serCollisionCapsules.Parse(buffer);
     Field12 = new DT_VARIABLEARRAY();
     Field12.Parse(buffer);
     nHardpointCount = buffer.ReadInt(32);
     serHardpoints = new SerializeData();
     serHardpoints.Parse(buffer);
     Field15 = new DT_VARIABLEARRAY();
     Field15.Parse(buffer);
     Field16 = new Vector3D();
     Field16.Parse(buffer);
     tOctreeVisualMesh = new Octree();
     tOctreeVisualMesh.Parse(buffer);
     aabbBounds = new AABB();
     aabbBounds.Parse(buffer);
     nLoopConstraintCount = buffer.ReadInt(32);
     serLoopConstraints = new SerializeData();
     serLoopConstraints.Parse(buffer);
     Field21 = new DT_VARIABLEARRAY();
     Field21.Parse(buffer);
     uRagdollDegrade = buffer.ReadInt(32);
     Field23 = buffer.ReadCharArray(256);
     Field24 = buffer.ReadCharArray(256);
     Field25 = buffer.ReadCharArray(256);
     Field26 = buffer.ReadCharArray(256);
     Field27 = buffer.ReadInt(32);
     Field28 = buffer.ReadFloat32();
     Field29 = buffer.ReadInt(32);
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     Field1 = buffer.ReadInt(32);
     Field2 = buffer.ReadFloat32();
     Field3 = buffer.ReadFloat32();
     Field4 = buffer.ReadFloat32();
     Field5 = buffer.ReadFloat32();
     Field6 = buffer.ReadFloat32();
     Field7 = buffer.ReadFloat32();
     Field8 = new UberMaterial();
     Field8.Parse(buffer);
     snoPhysics = buffer.ReadInt(32);
     Field10 = buffer.ReadInt(32);
     Field11 = buffer.ReadInt(32);
     Field12 = buffer.ReadInt(32);
     Field13 = buffer.ReadInt(32);
     Field14 = new ColorPath();
     Field14.Parse(buffer);
     Field15 = new ColorPath();
     Field15.Parse(buffer);
     Field16 = new FloatPath();
     Field16.Parse(buffer);
     Field17 = new FloatPath();
     Field17.Parse(buffer);
     Field18 = new FloatPath();
     Field18.Parse(buffer);
     Field19 = new FloatPath();
     Field19.Parse(buffer);
     Field20 = new FloatPath();
     Field20.Parse(buffer);
     Field21 = new FloatPath();
     Field21.Parse(buffer);
     Field22 = new FloatPath();
     Field22.Parse(buffer);
     Field23 = new FloatPath();
     Field23.Parse(buffer);
     Field24 = new FloatPath();
     Field24.Parse(buffer);
     Field25 = new FloatPath();
     Field25.Parse(buffer);
     Field26 = new VectorPath();
     Field26.Parse(buffer);
     Field27 = new VelocityPath();
     Field27.Parse(buffer);
     Field28 = buffer.ReadFloat32();
     Field29 = buffer.ReadFloat32();
     Field30 = new FloatPath();
     Field30.Parse(buffer);
     Field31 = new FloatPath();
     Field31.Parse(buffer);
     Field32 = new FloatPath();
     Field32.Parse(buffer);
     Field33 = new FloatPath();
     Field33.Parse(buffer);
     Field34 = new FloatPath();
     Field34.Parse(buffer);
     serMsgTriggeredEvents = new SerializeData();
     serMsgTriggeredEvents.Parse(buffer);
     Field36 = buffer.ReadInt(32);
     Field37 = new DT_VARIABLEARRAY();
     Field37.Parse(buffer);
 }
 public void Parse(GameBitBuffer buffer)
 {
     nMaxNodes = buffer.ReadInt(32);
     nMaxLeaves = buffer.ReadInt(32);
     nMaxPrimitives = buffer.ReadInt(32);
     nNodeCount = buffer.ReadInt(32);
     nLeafCount = buffer.ReadInt(32);
     nPrimitiveCount = buffer.ReadInt(32);
     serNodes = new SerializeData();
     serNodes.Parse(buffer);
     Field7 = new DT_VARIABLEARRAY();
     Field7.Parse(buffer);
     serLeaves = new SerializeData();
     serLeaves.Parse(buffer);
     Field9 = new DT_VARIABLEARRAY();
     Field9.Parse(buffer);
     serPrimitives = new SerializeData();
     serPrimitives.Parse(buffer);
     Field11 = new DT_VARIABLEARRAY();
     Field11.Parse(buffer);
 }
Beispiel #40
0
    public static string UI_ToString(SerializeData data)
    {
        StringBuilder str = new StringBuilder();
        str.Append("<item ");
        foreach (var item in data.property)
        {
            str.AppendFormat("{0}=\"{1}\" ", item.Key, item.Value);
        }

        str.Append(">");
        bool havedata = false;
        foreach (var item in data.childs)
        {
            if (item.Value.Count > 0)
            {
                havedata = true;
                str.AppendFormat("\r\n<{0}>\r\n", item.Key);
                for (int i = 0; i < item.Value.Count; i++)
                {
                    str.Append(UI_ToString(item.Value[i]));
                }
                str.AppendFormat("</{0}>", item.Key);
            }
        }
        if (havedata)
        {
            str.Append("\r\n");
        }
        str.Append("</item>\r\n");

        return str.ToString();
    }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = new Structure();
     Field0.Parse(buffer);
     Field1 = buffer.ReadInt(32);
     Field2 = buffer.ReadInt(32);
     serAppearanceMaterials = new SerializeData();
     serAppearanceMaterials.Parse(buffer);
     Field4 = new DT_VARIABLEARRAY();
     Field4.Parse(buffer);
     serAppearanceLooks = new SerializeData();
     serAppearanceLooks.Parse(buffer);
     Field6 = new DT_VARIABLEARRAY();
     Field6.Parse(buffer);
     nStaticLightCount = buffer.ReadInt(32);
     serStaticLights = new SerializeData();
     serStaticLights.Parse(buffer);
     Field9 = new DT_VARIABLEARRAY();
     Field9.Parse(buffer);
     Field10 = buffer.ReadInt(32);
     Field11 = buffer.ReadInt(32);
     Field12 = buffer.ReadInt(32);
     Field13 = buffer.ReadInt(32);
     Field14 = buffer.ReadInt(32);
     Field15 = buffer.ReadInt(32);
     Field16 = buffer.ReadInt(32);
     Field17 = buffer.ReadFloat32();
     Field18 = buffer.ReadInt(32);
     Field19 = buffer.ReadInt(32);
     Field20 = buffer.ReadInt64(64);
     Field21 = buffer.ReadInt(32);
 }
 public void Parse(GameBitBuffer buffer)
 {
     snoScene = buffer.ReadInt(32);
     Field1 = buffer.ReadInt(32);
     Field2 = buffer.ReadInt(32);
     Field3 = new DT_VARIABLEARRAY();
     Field3.Parse(buffer);
     serLabels = new SerializeData();
     serLabels.Parse(buffer);
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadCharArray(128);
     Field1 = buffer.ReadInt(32);
     Field2 = buffer.ReadInt(32);
     Field3 = new DT_VARIABLEARRAY();
     Field3.Parse(buffer);
     serSubSceneGroups = new SerializeData();
     serSubSceneGroups.Parse(buffer);
     Field5 = new SubSceneGroup();
     Field5.Parse(buffer);
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = new DT_VARIABLEARRAY();
     Field0.Parse(buffer);
     serEntry = new SerializeData();
     serEntry.Parse(buffer);
     Field2 = buffer.ReadCharArray(80);
     Field3 = buffer.ReadCharArray(256);
 }
 public void Parse(GameBitBuffer buffer)
 {
     serBuffFilterPowers = new SerializeData();
     serBuffFilterPowers.Parse(buffer);
     arBuffFilterPowers = new DT_VARIABLEARRAY();
     arBuffFilterPowers.Parse(buffer);
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     Field1 = new DT_VARIABLEARRAY();
     Field1.Parse(buffer);
     serRules = new SerializeData();
     serRules.Parse(buffer);
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = new InterpolationPathHeader();
     Field0.Parse(buffer);
     Field1 = new DT_VARIABLEARRAY();
     Field1.Parse(buffer);
     serNodes = new SerializeData();
     serNodes.Parse(buffer);
 }
Beispiel #48
0
            public NavMeshDef(MpqFileStream stream)
            {
                SquaresCountX = stream.ReadInt32();
                SquaresCoountY = stream.ReadInt32();
                i0 = stream.ReadInt32();
                NavMeshSquareCount = stream.ReadInt32();
                f0 = stream.ReadFloat();
                serNavMeshArraySquares = new SerializeData(stream);
                long x = stream.Position;
                stream.Position = serNavMeshArraySquares.Offset + 16;

                NavMeshArraySquares = new NavMeshSquare[NavMeshSquareCount];
                for (int i = 0; i < NavMeshSquareCount; i++)
                {
                    NavMeshArraySquares[i] = new NavMeshSquare(stream);
                }

                stream.Position = x;
                stream.Position += 12;
                filename = new char[256];

                for (int i = 0; i < 256; i++)
                {
                    filename[i] = (char) stream.ReadByte(); // fix me / dark
                }
            }
Beispiel #49
0
    /// <summary>
    /// 序列化任务
    /// </summary>
    /// <param name="task"></param>
    /// <param name="behavior"></param>
    /// <param name="taskCount"></param>
    /// <returns></returns>
    public static SerializeData SerializeTask_Data(Task task)
    {
        SerializeData xd = new SerializeData();
        Dictionary<string, string> dictionary = new Dictionary<string, string>();
        dictionary.Add("Name", task.NodeData.FriendlyName);
        task.Serialize(dictionary);
        xd.childs_self = task.SerializeChild();
        xd.property = dictionary;

        foreach (var item in task.OutLinks)
        {
            List<SerializeData> sds = new List<SerializeData>();
            for (int i = 0; i < item.Value.Childs.Count; i++)
            {
                SerializeData xd_child = SerializeTask_Data(item.Value.Childs[i]);
                sds.Add(xd_child);
            }
            xd.childs.Add(item.Key, sds);
        }
        return xd;
    }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     serVertices = new SerializeData();
     serVertices.Parse(buffer);
     Field2 = new DT_VARIABLEARRAY();
     Field2.Parse(buffer);
     Field3 = buffer.ReadInt(32);
     serFaces = new SerializeData();
     serFaces.Parse(buffer);
     Field5 = new DT_VARIABLEARRAY();
     Field5.Parse(buffer);
     Field6 = buffer.ReadInt(32);
     serStaples = new SerializeData();
     serStaples.Parse(buffer);
     Field8 = new DT_VARIABLEARRAY();
     Field8.Parse(buffer);
     Field9 = buffer.ReadInt(32);
     serDistanceConstraints = new SerializeData();
     serDistanceConstraints.Parse(buffer);
     Field11 = new DT_VARIABLEARRAY();
     Field11.Parse(buffer);
     Field12 = buffer.ReadInt(32);
     serBendingConstraints = new SerializeData();
     serBendingConstraints.Parse(buffer);
     Field14 = new DT_VARIABLEARRAY();
     Field14.Parse(buffer);
     Field15 = buffer.ReadInt(32);
     Field16 = buffer.ReadFloat32();
 }
Beispiel #51
0
    /// <summary>
    /// 序列化任务
    /// </summary>
    /// <param name="task"></param>
    /// <param name="behavior"></param>
    /// <param name="taskCount"></param>
    /// <returns></returns>
    public static SerializeData SerializeTask_UI(Task task)
    {
        SerializeData xd = new SerializeData();
        Dictionary<string, string> dictionary = new Dictionary<string, string>();
        dictionary.Add("ObjectType", task.GetType().ToString());
        task.NodeData.serialize_ui(dictionary);
        task.SerializeUI(dictionary);
        xd.property = dictionary;

        foreach (var item in task.OutLinks)
        {
            List<SerializeData> sds = new List<SerializeData>();
            for (int i = 0; i < item.Value.Childs.Count; i++)
            {
                SerializeData xd_child = SerializeTask_UI(item.Value.Childs[i]);
                sds.Add(xd_child);
            }
            xd.childs.Add(item.Key, sds);
        }
        return xd;
    }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     nVertCount = buffer.ReadInt(32);
     serVertList = new SerializeData();
     serVertList.Parse(buffer);
     Field3 = new DT_VARIABLEARRAY();
     Field3.Parse(buffer);
     serInfluenceList = new SerializeData();
     serInfluenceList.Parse(buffer);
     Field5 = new DT_VARIABLEARRAY();
     Field5.Parse(buffer);
     nIndexCount = buffer.ReadInt(32);
     serIndexList = new SerializeData();
     serIndexList.Parse(buffer);
     Field8 = new DT_VARIABLEARRAY();
     Field8.Parse(buffer);
     serClothStructure = new SerializeData();
     serClothStructure.Parse(buffer);
     Field10 = new DT_VARIABLEARRAY();
     Field10.Parse(buffer);
     snoSurface = buffer.ReadInt(32);
     Field12 = buffer.ReadInt(32);
     Field13 = buffer.ReadFloat32();
     Field14 = buffer.ReadCharArray(128);
     Field15 = buffer.ReadCharArray(128);
     aabbBounds = new AABB();
     aabbBounds.Parse(buffer);
     nShapeCount = buffer.ReadInt(32);
     serShapes = new SerializeData();
     serShapes.Parse(buffer);
     Field19 = new DT_VARIABLEARRAY();
     Field19.Parse(buffer);
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadCharArray(128);
     serSOAs = new SerializeData();
     serSOAs.Parse(buffer);
     Field2 = new DT_VARIABLEARRAY();
     Field2.Parse(buffer);
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     serSubObjects = new SerializeData();
     serSubObjects.Parse(buffer);
     Field2 = new DT_VARIABLEARRAY();
     Field2.Parse(buffer);
 }
Beispiel #55
0
 public SequenceInfo(SerializeData.Sequence seqData)
 {
     data 				= seqData;
         sceneIndex	= 0;
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     Field1 = buffer.ReadInt(32);
     Field2 = buffer.ReadInt(32);
     Field3 = buffer.ReadInt(32);
     Field4 = buffer.ReadFloat32();
     Field5 = buffer.ReadFloat32();
     Field6 = buffer.ReadFloat32();
     serPolytope = new SerializeData();
     serPolytope.Parse(buffer);
     Field8 = new DT_VARIABLEARRAY();
     Field8.Parse(buffer);
     Field9 = new Vector3D();
     Field9.Parse(buffer);
     Field10 = new Vector3D();
     Field10.Parse(buffer);
     Field11 = buffer.ReadFloat32();
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     Field1 = buffer.ReadFloat32();
     Field2 = buffer.ReadInt(32);
     Field3 = buffer.ReadInt(32);
     serPlaylistEntries = new SerializeData();
     serPlaylistEntries.Parse(buffer);
     Field5 = buffer.ReadInt(32);
     Field6 = new DT_VARIABLEARRAY();
     Field6.Parse(buffer);
     Field7 = new RandomMusicSoundParams[2];
     for(int i = 0;i < _Field7.Length;i++)
     {
         _Field7[i] = new RandomMusicSoundParams();
         _Field7[i].Parse(buffer);
     }
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadCharArray(64);
     Field1 = buffer.ReadInt(32);
     Field2 = new AABB();
     Field2.Parse(buffer);
     wsBounds = new Sphere();
     wsBounds.Parse(buffer);
     Field4 = new PRSTransform();
     Field4.Parse(buffer);
     Field5 = new PRSTransform();
     Field5.Parse(buffer);
     Field6 = new PRSTransform();
     Field6.Parse(buffer);
     Field7 = buffer.ReadInt(32);
     serShapes = new SerializeData();
     serShapes.Parse(buffer);
     Field9 = new DT_VARIABLEARRAY();
     Field9.Parse(buffer);
     serConstraint = new SerializeData();
     serConstraint.Parse(buffer);
     Field11 = new DT_VARIABLEARRAY();
     Field11.Parse(buffer);
     snoParticleSystem = buffer.ReadInt(32);
 }
 public void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadCharArray(128);
     Field1 = new LabelCondition();
     Field1.Parse(buffer);
     Field2 = buffer.ReadInt(32);
     Field3 = buffer.ReadInt(32);
     Field4 = new DT_VARIABLEARRAY();
     Field4.Parse(buffer);
     serEntries = new SerializeData();
     serEntries.Parse(buffer);
 }
Beispiel #60
0
            public NavZoneDef(MpqFileStream stream)
            {
                long x;
                int NavCellCount = stream.ReadInt32();
                stream.Position += 12;

                var serNavCells = new SerializeData(stream);
                x = stream.Position;
                stream.Position = serNavCells.Offset + 16;

                //Navcells
                NavCells = new NavCell[NavCellCount];
                for (int i = 0; i < NavCellCount; i++)
                {
                    NavCells[i] = new NavCell(stream);
                }
                stream.Position = x;

                //NavCellLookups
                int NeighbourCount = stream.ReadInt32();
                stream.Position += 12;
                var serNavCellNeighbours = new SerializeData(stream);
                x = stream.Position;
                stream.Position = serNavCellNeighbours.Offset + 16;
                NavCellNeighbours = new NavCellLookup[NeighbourCount];
                for (int i = 0; i < NeighbourCount; i++)
                {
                    NavCellNeighbours[i] = new NavCellLookup(stream);
                }
                stream.Position = x;

                //NavGridSquares
                float f0 = stream.ReadFloat();
                float f1 = stream.ReadFloat();
                int i2 = stream.ReadInt32();
                var v0 = new Vector2D(stream);
                stream.Position += 12;
                var serGridSquares = new SerializeData(stream);
                x = stream.Position;
                stream.Position = serGridSquares.Offset + 16;
                GridSquares = new NavGridSquare[serGridSquares.Size/6];
                for (int i = 0; i < serGridSquares.Size/6; i++)
                {
                    GridSquares[i] = new NavGridSquare(stream);
                }
                stream.Position = x;

                //cell lookups
                int i3 = stream.ReadInt32();
                stream.Position += 12;
                var serCellLookups = new SerializeData(stream);
                x = stream.Position;
                stream.Position = serCellLookups.Offset + 16;
                CellLookups = new NavCellLookup[serCellLookups.Size/4];
                for (int i = 0; i < serCellLookups.Size/4; i++)
                {
                    CellLookups[i] = new NavCellLookup(stream);
                }
                stream.Position = x;

                //borderdata
                int i4 = stream.ReadInt32();
                stream.Position += 12;
                var serBorderData = new SerializeData(stream);
                x = stream.Position;
                stream.Position = serBorderData.Offset + 16;
                BorderData = new NavCellBorderData[serBorderData.Size/4];
                for (int i = 0; i < serBorderData.Size/4; i++)
                {
                    BorderData[i] = new NavCellBorderData(stream);
                }
            }