CharacterLevelingStatistics.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // CharacterLevelingStatistics.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using System;
  11. using Microsoft.Xna.Framework.Content;
  12. #endregion
  13. namespace RolePlayingGameData
  14. {
  15. /// <summary>
  16. /// Information about how to increment statistics with additional character levels.
  17. /// </summary>
  18. #if !XBOX
  19. [Serializable]
  20. #endif
  21. public struct CharacterLevelingStatistics
  22. {
  23. /// <summary>
  24. /// The amount that the character's health points will increase.
  25. /// </summary>
  26. public Int32 HealthPointsIncrease;
  27. /// <summary>
  28. /// The number of levels between each health point increase.
  29. /// </summary>
  30. public Int32 LevelsPerHealthPointsIncrease;
  31. /// <summary>
  32. /// The amount that the character's magic points will increase.
  33. /// </summary>
  34. public Int32 MagicPointsIncrease;
  35. /// <summary>
  36. /// The number of levels between each magic point increase.
  37. /// </summary>
  38. public Int32 LevelsPerMagicPointsIncrease;
  39. /// <summary>
  40. /// The amount that the character's physical offense will increase.
  41. /// </summary>
  42. public Int32 PhysicalOffenseIncrease;
  43. /// <summary>
  44. /// The number of levels between each physical offense increase.
  45. /// </summary>
  46. public Int32 LevelsPerPhysicalOffenseIncrease;
  47. /// <summary>
  48. /// The amount that the character's physical defense will increase.
  49. /// </summary>
  50. public Int32 PhysicalDefenseIncrease;
  51. /// <summary>
  52. /// The number of levels between each physical defense increase.
  53. /// </summary>
  54. public Int32 LevelsPerPhysicalDefenseIncrease;
  55. /// <summary>
  56. /// The amount that the character's magical offense will increase.
  57. /// </summary>
  58. public Int32 MagicalOffenseIncrease;
  59. /// <summary>
  60. /// The number of levels between each magical offense increase.
  61. /// </summary>
  62. public Int32 LevelsPerMagicalOffenseIncrease;
  63. /// <summary>
  64. /// The amount that the character's magical defense will increase.
  65. /// </summary>
  66. public Int32 MagicalDefenseIncrease;
  67. /// <summary>
  68. /// The number of levels between each magical defense increase.
  69. /// </summary>
  70. public Int32 LevelsPerMagicalDefenseIncrease;
  71. #region Content Type Reader
  72. /// <summary>
  73. /// Reads a CharacterLevelingStatistics object from the content pipeline.
  74. /// </summary>
  75. public class CharacterLevelingStatisticsReader :
  76. ContentTypeReader<CharacterLevelingStatistics>
  77. {
  78. /// <summary>
  79. /// Reads a CharacterLevelingStatistics object from the content pipeline.
  80. /// </summary>
  81. protected override CharacterLevelingStatistics Read(ContentReader input,
  82. CharacterLevelingStatistics existingInstance)
  83. {
  84. CharacterLevelingStatistics stats = existingInstance;
  85. stats.HealthPointsIncrease = input.ReadInt32();
  86. stats.MagicPointsIncrease = input.ReadInt32();
  87. stats.PhysicalOffenseIncrease = input.ReadInt32();
  88. stats.PhysicalDefenseIncrease = input.ReadInt32();
  89. stats.MagicalOffenseIncrease = input.ReadInt32();
  90. stats.MagicalDefenseIncrease = input.ReadInt32();
  91. stats.LevelsPerHealthPointsIncrease = input.ReadInt32();
  92. stats.LevelsPerMagicPointsIncrease = input.ReadInt32();
  93. stats.LevelsPerPhysicalOffenseIncrease = input.ReadInt32();
  94. stats.LevelsPerPhysicalDefenseIncrease = input.ReadInt32();
  95. stats.LevelsPerMagicalOffenseIncrease = input.ReadInt32();
  96. stats.LevelsPerMagicalDefenseIncrease = input.ReadInt32();
  97. return stats;
  98. }
  99. }
  100. #endregion
  101. }
  102. }