Player.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // Player.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 System.Collections.Generic;
  12. using System.Text;
  13. #endregion
  14. namespace Spacewar
  15. {
  16. /// <summary>
  17. /// Represents the current state of each player in the game
  18. /// </summary>
  19. public class Player
  20. {
  21. /// <summary>
  22. /// The current ship class the player is using
  23. /// </summary>
  24. private ShipClass shipClass = ShipClass.Pencil;
  25. /// <summary>
  26. /// The current skin the player ship is using
  27. /// </summary>
  28. private int skin;
  29. /// <summary>
  30. /// The amount of cash the current player has to spend
  31. /// </summary>
  32. private int cash;
  33. /// <summary>
  34. /// The current weapon the player is using
  35. /// </summary>
  36. private ProjectileType projectileType = ProjectileType.Peashooter;
  37. /// <summary>
  38. /// The current score for this player
  39. /// </summary>
  40. private int score;
  41. /// <summary>
  42. /// The current health level for this player
  43. /// </summary>
  44. private int health = 5;
  45. #region Properties
  46. public ShipClass ShipClass
  47. {
  48. get
  49. {
  50. return shipClass;
  51. }
  52. set
  53. {
  54. shipClass = value;
  55. }
  56. }
  57. public int Cash
  58. {
  59. get
  60. {
  61. return cash;
  62. }
  63. set
  64. {
  65. cash = value;
  66. }
  67. }
  68. public int Score
  69. {
  70. get
  71. {
  72. return score;
  73. }
  74. set
  75. {
  76. score = value;
  77. }
  78. }
  79. public int Skin
  80. {
  81. get
  82. {
  83. return skin;
  84. }
  85. set
  86. {
  87. skin = value;
  88. }
  89. }
  90. public int Health
  91. {
  92. get
  93. {
  94. return health;
  95. }
  96. set
  97. {
  98. health = value;
  99. }
  100. }
  101. public ProjectileType ProjectileType
  102. {
  103. get
  104. {
  105. return projectileType;
  106. }
  107. set
  108. {
  109. projectileType = value;
  110. }
  111. }
  112. #endregion
  113. }
  114. }