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 app
    `static class` | `LaunchRulesBase.Mode` | The name refers to the directory from whih trial lists or rule sets are read
    `static 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 user
    `protected boolean` | `mustUseDevClient` | This will be set to true in the MLC page (LaunchMain), to guarantee
    `String` | `tableText` |

    - ### Fields inherited from class edu.wisc.game.web.ResultsBase

      `displayName, infomsg, uid`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `LaunchRulesBase​(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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 tables
    `protected 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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### allPlayers

          protected HashMap<String,​Vector<PlayerInfo>> allPlayers

      All PlayerInfo objects associated with this repeat user

    - #### tableText

          public String tableText

    - #### mustUseDevClient

          protected boolean mustUseDevClient

      This will be set to true in the MLC page (LaunchMain), to guarantee

  - ### Constructor Detail

    - #### LaunchRulesBase

          public LaunchRulesBase​(jakarta.servlet.http.HttpServletRequest request,
                                 jakarta.servlet.http.HttpServletResponse response)

  - ### Method Detail

    - #### mkForm

          protected String mkForm​(String text1,
                                  String text2,
                                  String exp,
                                  String pid,
                                  String buttonText)

    - #### mkCell

          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.
      Parameters:
        `exp` - The experiment plan the button(s) for which we are creating
        `ri` - Also add the necessary info to this structure

    - #### describeTrialList

          protected String describeTrialList​(TrialList t,
                                             HashSet<String> knownRuleSetNames)
                                      throws Exception

      Creates 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 part
        `modsLong` - Modifiers for Part B. If null, skip this part.
        `chosenRuleSet` - If not null, we just show this rule set in Part B table