GameState.cs


SUBMITTED BY: DavidEid

DATE: Aug. 6, 2017, 7:13 a.m.

FORMAT: C#

SIZE: 1.3 kB

HITS: 339

  1. #region Dailysigin
  2. public void AddCumulativeDays(int xflag)
  3. {
  4. var flag = (uint)(1 << (xflag - 1));
  5. CumulativeDays |= flag;
  6. }
  7. public bool ContainsCumulativeDays(int xflag)
  8. {
  9. var flag = (uint)(1 << (xflag - 1));
  10. var aux = CumulativeDays;
  11. aux &= ~flag;
  12. return !(aux == CumulativeDays);
  13. }
  14. public byte SignClaim
  15. {
  16. get { return this["SignClaim"]; }
  17. set
  18. {
  19. this["SignClaim"] = value;
  20. }
  21. }
  22. public ushort LateSignChance
  23. {
  24. get { return this["LateSignChance"]; }
  25. set
  26. {
  27. this["LateSignChance"] = value;
  28. }
  29. }
  30. public int GetCumulativeDaysCount()
  31. {
  32. var count = 0;
  33. for (int x = 1; x <= 30; x++)
  34. {
  35. if (ContainsCumulativeDays(x))
  36. count++;
  37. }
  38. return count;
  39. }
  40. public uint CumulativeDays
  41. {
  42. get { return this["CumulativeDays"]; }
  43. set
  44. {
  45. this["CumulativeDays"] = value;
  46. }
  47. }
  48. #endregion

comments powered by Disqus