PageRenderTime 44ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/WorldView/Structures/NPC.cs

#
C# | 153 lines | 140 code | 13 blank | 0 comment | 0 complexity | 990b4d0609e897aef8aadc0a3cd2be4b MD5 | raw file
  1. using System;
  2. using System.Drawing;
  3. namespace MoreTerra.Structures
  4. {
  5. public enum NPCType
  6. {
  7. ArmsDealer = 0,
  8. Clothier,
  9. Cyborg,
  10. Demolitionist,
  11. Dryad,
  12. DyeTrader = 5,
  13. GoblinTinkerer,
  14. Guide,
  15. Mechanic,
  16. Merchant,
  17. Nurse = 10,
  18. OldMan,
  19. Painter,
  20. PartyGirl,
  21. Pirate,
  22. SantaClaus = 15,
  23. Steampunker,
  24. Truffle,
  25. WitchDoctor,
  26. Wizard,
  27. Unknown = 20
  28. }
  29. public class NPC
  30. {
  31. private Int32 npcId;
  32. private Boolean activeNpc;
  33. private String npcName;
  34. private PointSingle npcPosition;
  35. private Boolean isNpcHomeless;
  36. private Point npcHomeTile;
  37. private NPCType npcType;
  38. #region Constructors
  39. public NPC()
  40. {
  41. npcId = -1;
  42. activeNpc = false;
  43. npcName = String.Empty;
  44. npcPosition = new PointSingle(0, 0);
  45. isNpcHomeless = false;
  46. npcHomeTile = new Point(0, 0);
  47. npcType = NPCType.Unknown;
  48. }
  49. public NPC(Int32 id, Boolean active, String name, PointSingle pos, Boolean homeless, Point home)
  50. {
  51. npcId = id;
  52. activeNpc = active;
  53. npcName = name;
  54. isNpcHomeless = homeless;
  55. npcHomeTile = home;
  56. npcPosition = pos;
  57. npcType = NPCType.Unknown;
  58. }
  59. #endregion
  60. #region GetSet Functions
  61. public Int32 Id
  62. {
  63. get
  64. {
  65. return npcId;
  66. }
  67. set
  68. {
  69. npcId = value;
  70. }
  71. }
  72. public Boolean Homeless
  73. {
  74. get
  75. {
  76. return isNpcHomeless;
  77. }
  78. set
  79. {
  80. isNpcHomeless = value;
  81. }
  82. }
  83. public PointSingle Position
  84. {
  85. get
  86. {
  87. return npcPosition;
  88. }
  89. set
  90. {
  91. npcPosition = value;
  92. }
  93. }
  94. public Point HomeTile
  95. {
  96. get
  97. {
  98. return npcHomeTile;
  99. }
  100. set
  101. {
  102. npcHomeTile = value;
  103. }
  104. }
  105. public Boolean Active
  106. {
  107. get
  108. {
  109. return activeNpc;
  110. }
  111. set
  112. {
  113. activeNpc = value;
  114. }
  115. }
  116. public String Name
  117. {
  118. get
  119. {
  120. return npcName;
  121. }
  122. set
  123. {
  124. npcName = value;
  125. }
  126. }
  127. public NPCType Type
  128. {
  129. get
  130. {
  131. return npcType;
  132. }
  133. set
  134. {
  135. npcType = value;
  136. }
  137. }
  138. #endregion
  139. }
  140. }