/// <summary> /// Sets the provided game control in provided mode. /// </summary> /// <param name="inMode"></param> private void setGameControl(PlayerModeEnum inMode, string inControlName, int inIndex, string inInput) { // Written, 02.09.2018 if (inIndex != 1 && inIndex != 2) { MoControlsMod.print("<b>C285 PControlManager</b>\r\nIndex out of range for game control editing...", DebugTypeEnum.full); throw new IndexOutOfRangeException(); } switch (inMode) { case PlayerModeEnum.Driving: for (int i = 0; i < drivingControls.GetLength(0); i++) { string _controlName = drivingControls[i, 0]; if (inControlName == _controlName) { drivingControls[i, inIndex] = inInput; break; } } if (currentPlayerMode == inMode) { loadControlModeToCInput(inMode, drivingControls); } break; case PlayerModeEnum.OnFoot: for (int i = 0; i < footControls.GetLength(0); i++) { string _controlName = footControls[i, 0]; if (inControlName == _controlName) { footControls[i, inIndex] = inInput; break; } } if (currentPlayerMode == inMode) { loadControlModeToCInput(inMode, footControls); } break; } }
public PlayerModeViewModel Initialize(PlayerModeEnum mode, string caption) { PlayerMode = mode; Caption = caption; return(this); }