示例#1
0
        /// <summary>
        /// Writes the block data to the underlying stream.
        /// </summary>
        /// <param name="writer">The writer.</param>
        public override void Write(BinaryWriter writer)
        {
            base.Write(writer);

            writer.WriteByteString(SpawnName);
            writer.Write(NormalSpawnPoints.Count);

            NormalSpawnPoints.ForEach(spawn => {
                writer.WriteByteString(spawn.Name);
                writer.Write(spawn.Monster);
                writer.Write(spawn.Count);
            });

            writer.Write(TacticalSpawnPoints.Count);

            TacticalSpawnPoints.ForEach(spawn => {
                writer.WriteByteString(spawn.Name);
                writer.Write(spawn.Monster);
                writer.Write(spawn.Count);
            });

            writer.Write(Interval);
            writer.Write(Limit);
            writer.Write(Range);
            writer.Write(TacticalVariable);
        }
示例#2
0
        /// <summary>
        /// Reads the block data from the underlying stream.
        /// </summary>
        /// <param name="reader">The reader.</param>
        public override void Read(BinaryReader reader)
        {
            base.Read(reader);

            SpawnName = reader.ReadByteString();
            int normalCount = reader.ReadInt32();

            for (int i = 0; i < normalCount; i++)
            {
                MonsterSpawnPoint spawn = new MonsterSpawnPoint();
                spawn.Name    = reader.ReadByteString();
                spawn.Monster = reader.ReadInt32();
                spawn.Count   = reader.ReadInt32();

                NormalSpawnPoints.Add(spawn);
            }

            int tacticalCount = reader.ReadInt32();

            for (int i = 0; i < tacticalCount; i++)
            {
                MonsterSpawnPoint spawn = new MonsterSpawnPoint();
                spawn.Name    = reader.ReadByteString();
                spawn.Monster = reader.ReadInt32();
                spawn.Count   = reader.ReadInt32();

                TacticalSpawnPoints.Add(spawn);
            }

            Interval         = reader.ReadInt32();
            Limit            = reader.ReadInt32();
            Range            = reader.ReadInt32();
            TacticalVariable = reader.ReadInt32();
        }