/// <summary> /// Create a new instance of this class /// </summary> /// <param name="realPatch">The real patch to use</param> public Patch(AvailablePatches realPatch) { char lastChar = ' '; int currentPosition = 0; List <int> spacePositions = new List <int>(); string name = realPatch.ToString(); foreach (char currentChar in name) { if (lastChar != ' ') { if (char.IsLower(lastChar) && char.IsUpper(currentChar)) { spacePositions.Add(currentPosition); } } lastChar = currentChar; currentPosition++; } currentPosition = 0; foreach (int position in spacePositions) { int realPosition = position + currentPosition; name = name.Insert(realPosition, " "); currentPosition++; } Name = name; RealPatch = realPatch; }
public void SetPatch(AvailablePatches availablePatch) { if (DataContext is LaunchGameModelView launchGameModel) { Patch patch = new Patch(availablePatch); launchGameModel.SetPatch(patch); } }
/// <summary> /// Create a new factory /// </summary> /// <param name="versionInformationUrl">The url to get the version information from</param> /// <param name="patch">The name of the patch file to get</param> /// <param name="speedMode">The speed mode to use</param> public LaunchGameFactory( string versionInformationUrl, AvailablePatches patch, SpeedModes speedMode ) { this.versionInformationUrl = versionInformationUrl; patchName = patch; this.speedMode = speedMode; }
/// <summary> /// Create a new instance of this class /// </summary> /// <param name="patch">The community patch type to download</param> public DownloadCommunityPatchTask(AvailablePatches patch) : this(patch.ToString()) { }
/// <summary> /// Create a new instance of this class /// </summary> /// <param name="button">The current button</param> /// <param name="Patch">The currently selected patch</param> public PatchSelectionData(ToggleButton button, AvailablePatches Patch) { Button = button; this.Patch = Patch; }
/// <summary> /// Create a new instance of this data container /// </summary> /// <param name="patch">The patch to use for launching</param> /// <param name="speed">The speed to use for launching</param> public LaunchGameData(AvailablePatches patch, SpeedModes speed) { Patch = patch; Speed = speed; }