Exemple #1
0
 public BaseFileReader(SortingStyle sorting = SortingStyle.Sort) : base()
 {
     this.sorting   = sorting;
     FileName       = "";
     DefaultSection = "General";
     content.Add(DefaultSection, new OrderedDictionary <string, string>());
 }
 /// <summary>
 /// Return Sorted List of Names
 /// </summary>
 /// <param name="unsortedNames"></param>
 /// <param name="sortStyle">Sort by first or Last Name</param>
 /// <returns>List of Sorted Name</returns>
 public List <FullName> Sort(List <FullName> unsortedNames, SortingStyle sortStyle)
 {
     if (sortStyle == SortingStyle.FIRST)
     {
         return(SortByFirstName(unsortedNames));
     }
     else
     {
         return(SortByLastName(unsortedNames));
     }
 }
    /// <summary>
    /// Sorts Inventory.
    /// </summary>
    /// <param name="style"></param>
    private void SortBy(SortingStyle style)
    {
        switch (style)
        {
        case SortingStyle.ByType:
            items.Sort((a, b) => a.itemType.CompareTo(b.itemType));
            break;

        case SortingStyle.ByRarity:
            items.Sort((a, b) => a.itemRarity.CompareTo(b.itemRarity));
            break;

        case SortingStyle.ByName:
            items.Sort((a, b) => a.itemName.CompareTo(b.itemName));
            break;
        }
        ResetInventory();
    }
Exemple #4
0
 public ColorFileReader(string file, SortingStyle sorting = SortingStyle.Sort) : base(file, sorting)
 {
 }
Exemple #5
0
 public BaseFileReader(char separator, string file, SortingStyle sorting = SortingStyle.Sort) : this(sorting)
 {
     KeySeparator = separator;
     Load(file);
 }
Exemple #6
0
 public BaseFileReader(string file, SortingStyle sorting = SortingStyle.Sort) : this(sorting)
 {
     Load(file);
 }
 public ContentSorting(SortingStyle sortingStyle)
 {
     SortingStyle = sortingStyle;
 }
 public ContentSorting(SortingStyle sortingStyle)
 {
     SortingStyle = sortingStyle;
 }