Class Puzzle
- java.lang.Object
-
- StatChangers
-
- Puzzle
-
public class Puzzle extends StatChangersThis class defines the rules and bonuses of the various puzzles in the game- Version:
- 1
- Author:
- Levi Yeo
-
-
Constructor Summary
Constructors Constructor Description Puzzle(Team t)Constructor for objects of class Puzzles
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAllowedPerk(int num)adds a new type of perk to the allowed listvoidbonus()booleangame()java.util.ArrayList<java.lang.Integer>getAllowedPerks()returns the type of perks that you are allowed to use on this puzzlejava.lang.StringgetHelp()booleangetQuit()TeamgetTeam()voidpunishment()voidremoveAllowedPerk(int num)removes a perk at the INDEX numvoidrun()runs the puzzle and decides whether the user has succesvoidsetAllowedPerks(java.util.ArrayList<java.lang.Integer> perks)sets the type of perks which are allowed to be used on this puzzlevoidsetHelp(java.lang.String h)Replaces the puzzle's help messagevoidsetQuit(boolean b)sets the value of quit which confirms if the user has quit the puzzle-
Methods inherited from class StatChangers
changeAddD, changeAddDWages, changeAddSp, changeAddSt, changeAddStWages, changeAddTMoney, changeWeight, getAddDWages, getAddStWages, getAddTMoney, getAllVars, getD, getDescription, getName, getSp, getSt, getWeight, setAddAll, setAddAll, setAddD, setAddDWages, setAddSp, setAddSt, setAddStWages, setAddTMoney, setDescription, setName, setWeight
-
-
-
-
Method Detail
-
getTeam
public Team getTeam()
- Returns:
- the team which this puzzle affects
-
getHelp
public java.lang.String getHelp()
- Returns:
- the puzzle's help message
-
setHelp
public void setHelp(java.lang.String h)
Replaces the puzzle's help message- Parameters:
String- h, the puzzle's new help message
-
getAllowedPerks
public java.util.ArrayList<java.lang.Integer> getAllowedPerks()
returns the type of perks that you are allowed to use on this puzzle
-
setAllowedPerks
public void setAllowedPerks(java.util.ArrayList<java.lang.Integer> perks)
sets the type of perks which are allowed to be used on this puzzle- Parameters:
perks- , the new value of allowedPerks list
-
addAllowedPerk
public void addAllowedPerk(int num)
adds a new type of perk to the allowed list- Parameters:
int- num, the type of perk to add to the list
-
removeAllowedPerk
public void removeAllowedPerk(int num)
removes a perk at the INDEX num- Parameters:
int- num, the index of the perk to remove.
-
run
public void run()
runs the puzzle and decides whether the user has succes
-
bonus
public void bonus()
-
punishment
public void punishment()
-
game
public boolean game()
-
getQuit
public boolean getQuit()
- Returns:
- the variable which confirms whether the user has quit the puzzle
-
setQuit
public void setQuit(boolean b)
sets the value of quit which confirms if the user has quit the puzzle- Parameters:
boolean- b, the new value of quit
-
-