Class Puzzle


  • public class Puzzle
    extends StatChangers
    This 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
      void addAllowedPerk​(int num)
      adds a new type of perk to the allowed list
      void bonus()  
      boolean game()  
      java.util.ArrayList<java.lang.Integer> getAllowedPerks()
      returns the type of perks that you are allowed to use on this puzzle
      java.lang.String getHelp()  
      boolean getQuit()  
      Team getTeam()  
      void punishment()  
      void removeAllowedPerk​(int num)
      removes a perk at the INDEX num
      void run()
      runs the puzzle and decides whether the user has succes
      void setAllowedPerks​(java.util.ArrayList<java.lang.Integer> perks)
      sets the type of perks which are allowed to be used on this puzzle
      void setHelp​(java.lang.String h)
      Replaces the puzzle's help message
      void setQuit​(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
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Puzzle

        public Puzzle​(Team t)
        Constructor for objects of class Puzzles
    • 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