GameStartDescriptionReader.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. //-----------------------------------------------------------------------------
  2. // GameStartDescriptionReader.cs
  3. //
  4. // Microsoft XNA Community Game Platform
  5. // Copyright (C) Microsoft Corporation. All rights reserved.
  6. //-----------------------------------------------------------------------------
  7. using System.Collections.Generic;
  8. using Microsoft.Xna.Framework.Content;
  9. namespace RolePlaying.Data
  10. {
  11. /// <summary>
  12. /// Read a GameStartDescription object from the content pipeline.
  13. /// </summary>
  14. public class GameStartDescriptionReader : ContentTypeReader<GameStartDescription>
  15. {
  16. protected override GameStartDescription Read(ContentReader input,
  17. GameStartDescription existingInstance)
  18. {
  19. GameStartDescription desc = existingInstance;
  20. if (desc == null)
  21. {
  22. desc = new GameStartDescription();
  23. }
  24. desc.MapContentName = input.ReadString();
  25. desc.PlayerContentNames.AddRange(input.ReadObject<List<string>>());
  26. desc.QuestLineContentName = input.ReadString();
  27. return desc;
  28. }
  29. }
  30. }