mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 03:56:31 +00:00
27 lines
885 B
C#
27 lines
885 B
C#
using System.Collections.Generic;
|
|
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
|
|
using MonoGame.Extended.Tiled.Serialization;
|
|
|
|
namespace MonoGame.Extended.Content.Pipeline.Tiled
|
|
{
|
|
public static class ContentWriterExtensions
|
|
{
|
|
// ReSharper disable once SuggestBaseTypeForParameter
|
|
public static void WriteTiledMapProperties(this ContentWriter writer, IReadOnlyCollection<TiledMapPropertyContent> value)
|
|
{
|
|
if (value == null)
|
|
{
|
|
writer.Write(0);
|
|
return;
|
|
}
|
|
writer.Write(value.Count);
|
|
foreach (var property in value)
|
|
{
|
|
writer.Write(property.Name);
|
|
writer.Write(property.Value ?? string.Empty);
|
|
WriteTiledMapProperties(writer, property.Properties);
|
|
}
|
|
}
|
|
}
|
|
}
|