示例#1
0
        /// <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;
        }
示例#2
0
 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;
 }
示例#4
0
 /// <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())
 {
 }
示例#5
0
 /// <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;
 }
示例#6
0
 /// <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;
 }