SlotBase.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. using System;
  2. using MaidStatus;
  3. using TextureBank;
  4. using UnityEngine;
  5. namespace Schedule
  6. {
  7. public class SlotBase
  8. {
  9. public Maid maid
  10. {
  11. get
  12. {
  13. if (GameMain.Instance.CharacterMgr.status.GetScheduleSlot(this.slotId) != this._maid)
  14. {
  15. this.Update();
  16. }
  17. return this._maid;
  18. }
  19. set
  20. {
  21. if (this._maid != value)
  22. {
  23. if (value == null)
  24. {
  25. GameMain.Instance.CharacterMgr.status.scheduleSlot[this.slotId].maid_guid = string.Empty;
  26. }
  27. else
  28. {
  29. GameMain.Instance.CharacterMgr.status.scheduleSlot[this.slotId].maid_guid = value.status.guid;
  30. }
  31. this._maid = value;
  32. this.Update();
  33. }
  34. }
  35. }
  36. public int slotId
  37. {
  38. get
  39. {
  40. return this._slotId;
  41. }
  42. }
  43. public int noonWorkId
  44. {
  45. get
  46. {
  47. return this.maid.status.noonWorkId;
  48. }
  49. set
  50. {
  51. this.maid.status.noonWorkId = value;
  52. }
  53. }
  54. public int nightWorkId
  55. {
  56. get
  57. {
  58. return this.maid.status.nightWorkId;
  59. }
  60. set
  61. {
  62. this.maid.status.nightWorkId = value;
  63. }
  64. }
  65. public bool noonCommuFlag
  66. {
  67. get
  68. {
  69. return this.maid.status.noonCommu;
  70. }
  71. set
  72. {
  73. this.maid.status.noonCommu = value;
  74. }
  75. }
  76. public int popular_rank
  77. {
  78. get
  79. {
  80. return this.maid.status.popularRank;
  81. }
  82. }
  83. public bool nightCommuFlag
  84. {
  85. get
  86. {
  87. return this.maid.status.nightCommu;
  88. }
  89. set
  90. {
  91. this.maid.status.nightCommu = value;
  92. }
  93. }
  94. public Texture2D popular_rank_icon
  95. {
  96. get
  97. {
  98. return this._popular_rank_icon;
  99. }
  100. }
  101. public Texture2D icon
  102. {
  103. get
  104. {
  105. return this.maid.GetThumIcon();
  106. }
  107. }
  108. public bool leader
  109. {
  110. get
  111. {
  112. return this.maid.status.leader;
  113. }
  114. }
  115. public string last_name
  116. {
  117. get
  118. {
  119. return this.maid.status.lastName;
  120. }
  121. }
  122. public string first_name
  123. {
  124. get
  125. {
  126. return this.maid.status.firstName;
  127. }
  128. }
  129. public Contract contract_type
  130. {
  131. get
  132. {
  133. return this.maid.status.contract;
  134. }
  135. }
  136. public string contract_type_name
  137. {
  138. get
  139. {
  140. string result = string.Empty;
  141. if (this.maid.status.heroineType == HeroineType.Sub)
  142. {
  143. result = this.maid.status.subCharaStatus.contractText;
  144. }
  145. else
  146. {
  147. result = EnumConvert.GetString(this.maid.status.contract);
  148. }
  149. return result;
  150. }
  151. }
  152. public Texture2D noon_icon
  153. {
  154. get
  155. {
  156. if (this.noon_icon_name == null)
  157. {
  158. return null;
  159. }
  160. return this.textureBank.GetTexture(this.noon_icon_name);
  161. }
  162. }
  163. public string noon_icon_name
  164. {
  165. get
  166. {
  167. if (!ScheduleCSVData.AllData.ContainsKey(this.maid.status.noonWorkId))
  168. {
  169. return null;
  170. }
  171. return ScheduleCSVData.AllData[this.maid.status.noonWorkId].icon;
  172. }
  173. }
  174. public Texture2D night_icon
  175. {
  176. get
  177. {
  178. if (this.night_icon_name == null)
  179. {
  180. return null;
  181. }
  182. return this.textureBank.GetTexture(this.night_icon_name);
  183. }
  184. }
  185. public string night_icon_name
  186. {
  187. get
  188. {
  189. if (!ScheduleCSVData.AllData.ContainsKey(this.maid.status.nightWorkId))
  190. {
  191. return null;
  192. }
  193. return ScheduleCSVData.AllData[this.maid.status.nightWorkId].icon;
  194. }
  195. }
  196. public Maid Maid
  197. {
  198. get
  199. {
  200. return this.maid;
  201. }
  202. }
  203. public virtual void Update()
  204. {
  205. this._maid = GameMain.Instance.CharacterMgr.status.GetScheduleSlot(this.slotId);
  206. this.UpdateRankIcon();
  207. }
  208. protected void UpdateRankIcon()
  209. {
  210. this._popular_rank_icon = null;
  211. if (this._maid != null && this.textureBank != null)
  212. {
  213. int popular_rank = this.popular_rank;
  214. if (popular_rank != 1)
  215. {
  216. if (popular_rank != 2)
  217. {
  218. if (popular_rank == 3)
  219. {
  220. this._popular_rank_icon = this.textureBank.GetTexture("cm3d2_management_crown_bronze");
  221. }
  222. }
  223. else
  224. {
  225. this._popular_rank_icon = this.textureBank.GetTexture("cm3d2_management_crown_silver");
  226. }
  227. }
  228. else
  229. {
  230. this._popular_rank_icon = this.textureBank.GetTexture("cm3d2_management_crown_gold");
  231. }
  232. }
  233. }
  234. protected Maid _maid;
  235. protected int _slotId;
  236. protected Texture2D _popular_rank_icon;
  237. public TextureBank textureBank;
  238. private const string POPULAR_RANK_ICON_1 = "cm3d2_management_crown_gold";
  239. private const string POPULAR_RANK_ICON_2 = "cm3d2_management_crown_silver";
  240. private const string POPULAR_RANK_ICON_3 = "cm3d2_management_crown_bronze";
  241. }
  242. }