Beispiel #1
0
        public static void Write(Stream stream, List <SpawnPoint> items)
        {
            stream.Write(2);
            stream.Write(items.Count);
            foreach (var item in items)
            {
                BinaryMapping.WriteObject(stream, new Raw
                {
                    Type                 = item.Type,
                    Flag                 = item.Flag,
                    Id                   = item.Id,
                    EntityCount          = (short)item.Entities.Count,
                    EventActivatorCount  = (short)item.EventActivators.Count,
                    WalkPathCount        = (short)item.WalkPath.Count,
                    ReturnParameterCount = (short)item.ReturnParameters.Count,
                    SignalCount          = (short)item.Signals.Count,
                    Reserved10           = 0,
                    Reserved14           = 0,
                    Reserved18           = 0,
                    Place                = item.Teleport.Place,
                    Door                 = item.Teleport.Door,
                    World                = item.Teleport.World,
                    Unk1f                = item.Teleport.Unknown,
                    Unk20                = item.Unk20,
                    Unk24                = item.Unk24,
                    Unk28                = 0,
                });

                foreach (var spawnPoint in item.Entities)
                {
                    Entity.Write(stream, spawnPoint);
                }
                foreach (var unk in item.EventActivators)
                {
                    EventActivator.Write(stream, unk);
                }
                foreach (var unk in item.WalkPath)
                {
                    WalkPathDesc.Write(stream, unk);
                }
                foreach (var unk in item.ReturnParameters)
                {
                    ReturnParameter.Write(stream, unk);
                }
                foreach (var unk in item.Signals)
                {
                    Signal.Write(stream, unk);
                }
            }
        }