You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Puzzle.java 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import java.util.ArrayList;
  2. public class Puzzle
  3. {
  4. private String name;
  5. private ArrayList<Item> items = new ArrayList<Item>();
  6. private String description="";
  7. private boolean solved = false;
  8. private String solvedText = "";
  9. private boolean gameOverFlag=false;
  10. private Room nextRoom = null;
  11. private String dependencyText = null;
  12. private Puzzle dependency= null;
  13. public Puzzle(String name)
  14. {
  15. this.name = name;
  16. }
  17. public boolean hasDependency()
  18. {
  19. return dependency != null;
  20. }
  21. public void setDependency(Puzzle p)
  22. {
  23. dependency = p;
  24. }
  25. public void setDependencyText(String s)
  26. {
  27. dependencyText = s;
  28. }
  29. public Puzzle getDependency()
  30. {
  31. return dependency;
  32. }
  33. public String getDependencyText()
  34. {
  35. return dependencyText;
  36. }
  37. public Room getNextRoom()
  38. {
  39. return nextRoom;
  40. }
  41. public void addItem(Item i)
  42. {
  43. items.add(i);
  44. }
  45. public ArrayList<Item> getItems() {
  46. return items;
  47. }
  48. public void setItems(ArrayList<Item> items) {
  49. this.items = items;
  50. }
  51. public String getName() {
  52. return name;
  53. }
  54. public void setName(String name) {
  55. this.name = name;
  56. }
  57. public String getDescription() {
  58. return description;
  59. }
  60. public void setDescription(String description) {
  61. this.description = description;
  62. }
  63. public String getSolvedText() {
  64. return solvedText;
  65. }
  66. public void setSolvedText(String solvedText) {
  67. this.solvedText = solvedText;
  68. }
  69. public boolean isSolved() {
  70. return solved;
  71. }
  72. public void setSolved(boolean solved) {
  73. this.solved = solved;
  74. }
  75. public void setGameOverFlag(boolean b) {
  76. // TODO Auto-generated method stub
  77. gameOverFlag = b;
  78. }
  79. public boolean getGameOverFlag() {
  80. // TODO Auto-generated method stub
  81. return gameOverFlag;
  82. }
  83. public void setNextRoom(Room r)
  84. {
  85. nextRoom = r;
  86. }
  87. }