Beispiel #1
0
 void Write(UE_Map value, PositionToken position)
 {
     if (position == PositionToken.Normal)
     {
         byte[] _R;
         using (var ms = new MemoryStream())
             using (var bw = new UE_BinaryWriter(ms, true))
             {
                 bw.Write((Int32)0);
                 bw.Write(value.Map.Count);
                 var ue_prop_w = new UE_Property_Writer(bw);
                 for (int i = 0; i < value.Map.Count; i++)
                 {
                     ue_prop_w.Write_UE_Value(value.Map[i].Key, PositionToken.InsideMap);
                     ue_prop_w.Write_UE_Value(value.Map[i].Value, PositionToken.InsideMap);
                 }
                 _R = ms.ToArray(); // cannot do Stream.CopyTo, reason unknown
             }
         long length = _R.Length;
         //
         Write_UE_Value_Hair(value.TypeString, length);
         writer.Write(value.KeyType);
         writer.Write(value.ValueType);
         writer.Write((byte)0);
         writer.Write(_R, 0, _R.Length);
     }
     else
     {
         throw new NotImplementedException(position.ToString());
     }
 }
 public static void WriteGvas(Stream stream, Gvas save)
 {
     using (var writer = new UE_BinaryWriter(stream, true))
     {
         SaveGameHeader.Write(writer, save.Header);
         var ue_prop_writer = new UE_Property_Writer(writer);
         for (int i = 0; i < save.PropertyList.Count; i++)
         {
             ue_prop_writer.Write(save.PropertyList[i], PositionToken.Normal);
         }
         ue_prop_writer.Write_UE_None();
         string Null_End = null;
         writer.Write(Null_End);
     }
 }
Beispiel #3
0
        void Write(UE_Array value, PositionToken position)
        {
            long length;

            byte[] _R;
            using (var ms = new MemoryStream())
                using (var bw = new UE_BinaryWriter(ms, true))
                {
                    var ue_prop_w = new UE_Property_Writer(bw);
                    for (int i = 0; i < value.ItemList.Length; i++)
                    {
                        ue_prop_w.Write_UE_Value(value.ItemList[i], PositionToken.InsideArray);
                    }
                    _R = ms.ToArray();
                }
            length = 4 + _R.Length;
            //
            Write_UE_Value_Hair(value.TypeString, length);
            Write_UE_Array_Header(value.ItemType);
            writer.Write(value.ItemList.Length);
            writer.Write(_R, 0, _R.Length);
        }
Beispiel #4
0
 void Write(UE_Struct_Generic value, PositionToken position)
 {
     if (position == PositionToken.Normal)
     {
         byte[] _R;
         using (var ms = new MemoryStream())
             using (var bw = new UE_BinaryWriter(ms, true))
             {
                 var ue_prop_w = new UE_Property_Writer(bw);
                 foreach (var prop in value.PropertyList)
                 {
                     ue_prop_w.Write(prop, PositionToken.Normal);
                 }
                 ue_prop_w.Write_UE_None();
                 //
                 _R = ms.ToArray();
             }
         long I64_Length = _R.Length;
         Write_UE_Value_Hair(value.TypeString, I64_Length);
         //
         Write_UE_Struct_Header(value.StructTypeString);
         writer.Write(_R, 0, _R.Length);
     }
     else if (position == PositionToken.InsideArray)
     {
         foreach (var prop in value.PropertyList)
         {
             Write(prop, PositionToken.Normal);
         }
         Write_UE_None();
     }
     else
     {
         throw new NotImplementedException(position.ToString());
     }
 }