armark1ng

Untitled

Jun 25th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. package com.rs.game.map.bossInstance;
  2.  
  3. import java.io.Serializable;
  4.  
  5. import com.rs.game.map.bossInstance.BossInstanceHandler.Boss;
  6. import com.rs.utils.Utils;
  7.  
  8. public class InstanceSettings implements Serializable {
  9.  
  10. private static final long serialVersionUID = 3082211665373930652L;
  11.  
  12. private Boss boss;
  13. private int minCombat, maxPlayers, spawnSpeed, protection;
  14. private boolean practiseMode, hardMode;
  15.  
  16. private long creationTime;
  17.  
  18. public InstanceSettings(Boss boss, int maxPlayers, int minCombat, int spawnSpeed, int protection, boolean practiseMode, boolean hardMode) {
  19. this.boss = boss;
  20. this.minCombat = minCombat;
  21. this.spawnSpeed = spawnSpeed;
  22. this.protection = protection;
  23. this.practiseMode = practiseMode;
  24. this.hardMode = hardMode;
  25. }
  26.  
  27. public InstanceSettings(Boss boss) {
  28. this.boss = boss;
  29. }
  30.  
  31. public void setPractiseMode(boolean practiseMode) {
  32. this.practiseMode = practiseMode;
  33. }
  34.  
  35. public void setHardMode(boolean hardMode) {
  36. this.hardMode = hardMode;
  37. }
  38.  
  39. public void setMinCombat(int minCombat) {
  40. this.minCombat = minCombat;
  41. }
  42.  
  43. public void setMaxPlayers(int maxPlayers) {
  44. this.maxPlayers = maxPlayers;
  45. }
  46.  
  47. public void setSpawnSpeed(int spawnSpeed) {
  48. this.spawnSpeed = spawnSpeed;
  49. }
  50.  
  51. public void setProtection(int protection) {
  52. this.protection = protection;
  53. }
  54.  
  55. public long getCreationTime() {
  56. return creationTime;
  57. }
  58.  
  59. public void setCreationTime(long creationTime) {
  60. this.creationTime = creationTime;
  61. }
  62.  
  63. public boolean isHardMode() {
  64. return hardMode;
  65. }
  66.  
  67. public boolean isPractiseMode() {
  68. return practiseMode;
  69. }
  70.  
  71. public int getMinCombat() {
  72. return minCombat;
  73. }
  74.  
  75. public int getProtection() {
  76. return protection;
  77. }
  78.  
  79. public int getSpawnSpeed() {
  80. return spawnSpeed;
  81. }
  82.  
  83. public Boss getBoss() {
  84. return boss;
  85. }
  86.  
  87. public int getMaxPlayers() {
  88. return maxPlayers;
  89. }
  90.  
  91. /*
  92. * in milliseconds
  93. */
  94. public long getTimeRemaining() {
  95. long diff = (Utils.currentTimeMillis() - creationTime);
  96. long timeRemaining = 60 * 60 * 1000 - diff;
  97. return timeRemaining < 0 ? 0 : timeRemaining;
  98. }
  99.  
  100. public boolean hasTimeRemaining() {
  101. return getTimeRemaining() > 0;
  102. }
  103. }
Add Comment
Please, Sign In to add comment