Esempio n. 1
0
        protected override void Write(ContentWriter output, TileRegistryContent value)
        {
            output.Write(value.Version);

            Guid     id   = value.Id;
            TilePool pool = value.TilePool;

            output.Write((short)id);
            output.Write((short)pool.TileWidth);
            output.Write((short)pool.TileHeight);
            output.Write(value.TextureAsset);

            WritePropertyBlock(output, pool.CustomProperties);

            output.Write((short)pool.Count);
            foreach (Tile tile in pool)
            {
                TileCoord coord = pool.GetTileLocation(tile.Uid);

                output.Write((short)tile.Uid);
                output.Write((short)coord.X);
                output.Write((short)coord.Y);

                WritePropertyBlock(output, tile.CustomProperties);
            }
        }