ContentEntryWriter.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //-----------------------------------------------------------------------------
  2. // ContentEntryWriter.cs
  3. //
  4. // Microsoft XNA Community Game Platform
  5. // Copyright (C) Microsoft Corporation. All rights reserved.
  6. //-----------------------------------------------------------------------------
  7. using System;
  8. using System.Collections.Generic;
  9. using Microsoft.Xna.Framework;
  10. using Microsoft.Xna.Framework.Graphics;
  11. using Microsoft.Xna.Framework.Content.Pipeline;
  12. using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
  13. using Microsoft.Xna.Framework.Content.Pipeline.Processors;
  14. using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
  15. using RolePlaying.Data;
  16. namespace RolePlaying.Processors
  17. {
  18. /// <summary>
  19. /// This class will be instantiated by the XNA Framework Content Pipeline
  20. /// to write the specified data type into binary .xnb format.
  21. ///
  22. /// This should be part of a Content Pipeline Extension Library project.
  23. /// </summary>
  24. [ContentTypeWriter]
  25. public class ContentEntryWriter<T> : RolePlayingGameWriter<ContentEntry<T>>
  26. where T : ContentObject
  27. {
  28. protected override void Write(ContentWriter output, ContentEntry<T> value)
  29. {
  30. output.Write(value.ContentName == null ? String.Empty : value.ContentName);
  31. output.Write(value.Count);
  32. }
  33. }
  34. }