/// <summary> /// Function called when form is loaded /// </summary> /// <param name="word"></param> /// <param name="type"></param> /// <param name="difficulty"></param> /// <param name="parameters"></param> public Session(string word, GameType type, SessionHelper.Difficulty difficulty = SessionHelper.Difficulty.Common, MpParameters parameters = null) { InitializeComponent(); Height = 520 ; //converts word to upper case just in case it isn't already _word = word.ToUpper(); _gameType = type; //Initialising phase names for each letter incorrect _phaseNames.Add(1, "Base"); _phaseNames.Add(2, "Post"); _phaseNames.Add(3, "Support 1"); _phaseNames.Add(4, "Support 2"); _phaseNames.Add(5, "Overhead"); _phaseNames.Add(6, "Noose"); _phaseNames.Add(7, "Head"); _phaseNames.Add(8, "Body"); _phaseNames.Add(9, "Left Arm"); _phaseNames.Add(10, "Right Arm"); _phaseNames.Add(11, "Left Leg"); _phaseNames.Add(12, "Right Leg (R.I.P)"); _phaseNames.Add(13, "RIP IN PEPPERONIES"); if (_gameType == GameType.Multi) { _multiplayerParams = parameters; if (_multiplayerParams != null) { chk_RevealWord.Checked = _multiplayerParams.RevealWord; chk_hideInput.Checked = _multiplayerParams.HideWord; } } _levelDifficulty = difficulty; //Sets text for top of form Text = "Game Session - " + _levelDifficulty + " Words"; }
//Creates an enumeration (list of constants) that is used for identification of the difficulty of singleplayer. /// <summary> /// Handles starting a new multiplayer session /// </summary> /// <param name="word">Word to use for new session</param> /// <param name="parameters">Instance of class MPParameters</param> public static void NewMultiplayer(string word, MpParameters parameters) { //Starts a new session using parameters and enum values new Session(word, Session.GameType.Multi,Difficulty.Common, parameters).Show(); }