2
0

CharacterLevelingStatistics.cs 4.1 KB

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