Package edu.wisc.game.web
Class LaunchRulesBase
java.lang.Object
edu.wisc.game.web.ResultsBase
edu.wisc.game.web.LaunchRulesBase
- Direct Known Subclasses:
LaunchMain
,LaunchRules
public class LaunchRulesBase extends ResultsBase
The common base for the Launch pages that allows one to play all
rule sets from rules/APP, rules/MLC, and others. As requested by Paul on
2021-10-12 and 2021-10-13.
The M need not provide bonuses, and can use the standard 4 colors and shapes. I'd suggest either 5 to 8 pieces (a random number). People should be able to give up even at the first screen, if that is supported.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LaunchRulesBase.AndroidRuleInfoReport
The list of rule sets to be displayed in the Android appstatic class
LaunchRulesBase.Mode
The name refers to the directory from whih trial lists or rule sets are readstatic class
LaunchRulesBase.RuleInfo
An auxiliary class that can be used to transmit information about the buttons etc the Android app needs to display -
Field Summary
Fields Modifier and Type Field Description protected HashMap<String,Vector<PlayerInfo>>
allPlayers
All PlayerInfo objects associated with this repeat userprotected boolean
mustUseDevClient
This will be set to true in the MLC page (LaunchMain), to guaranteeString
tableText
-
Constructor Summary
Constructors Constructor Description LaunchRulesBase(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
-
Method Summary
Modifier and Type Method Description protected void
buildTable(String[] modsShort, String[] modsLong, String[] hm, LaunchRulesBase.Mode z, String chosenRuleSet)
Builds Part A and Part B tablesprotected String
describeTrialList(TrialList t, HashSet<String> knownRuleSetNames)
Creates a description of a trial list, consisting of the descriptions of all rule sets in the list.protected String
mkCell(String exp)
Creates a table cell for a given P: or R: plan, with a "PLAY!" button and information about any previous rounds.protected String
mkForm(String text1, String text2, String exp, String pid, String buttonText)
Methods inherited from class edu.wisc.game.web.ResultsBase
exceptionTrace, getDisplayText, getErrmsg, getError, getEx, giveError, giveError, loggedIn, setErrmsg, setError
-
Field Details
-
allPlayers
All PlayerInfo objects associated with this repeat user -
tableText
-
mustUseDevClient
protected boolean mustUseDevClientThis will be set to true in the MLC page (LaunchMain), to guarantee
-
-
Constructor Details
-
LaunchRulesBase
public LaunchRulesBase(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
-
-
Method Details
-
mkForm
-
mkCell
Creates a table cell for a given P: or R: plan, with a "PLAY!" button and information about any previous rounds.- Parameters:
exp
- The experiment plan the button(s) for which we are creatingri
- Also add the necessary info to this structure
-
describeTrialList
protected String describeTrialList(TrialList t, HashSet<String> knownRuleSetNames) throws ExceptionCreates a description of a trial list, consisting of the descriptions of all rule sets in the list.- Parameters:
knownRuleSetNames
- The method will add all encountered rule set names to this set.- Throws:
Exception
-
buildTable
protected void buildTable(String[] modsShort, String[] modsLong, String[] hm, LaunchRulesBase.Mode z, String chosenRuleSet)Builds Part A and Part B tables- Parameters:
z
- "APP" or "MLC". This is the name of the directory (under the main rule set directory) in which to look for the rule set files.modsShort
- Modifiers for Part A. If null, skip this partmodsLong
- Modifiers for Part B. If null, skip this part.chosenRuleSet
- If not null, we just show this rule set in Part B table
-