-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1734f82
commit 0021238
Showing
3 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
MapleLib/WzLib/WzStructure/Data/CharacterStructure/CharacterClassTypeInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
MapleLib/WzLib/WzStructure/Data/CharacterStructure/CharacterSubJobFlagType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using MapleLib.WzLib.WzStructure.Data.QuestStructure; | ||
using System; | ||
namespace MapleLib.WzLib.WzStructure.Data.CharacterStructure | ||
{ | ||
/// <summary> | ||
/// Its the best guess so far, could not find it in KMST. | ||
/// </summary> | ||
public enum CharacterSubJobFlagType | ||
{ | ||
Any = 0, | ||
Adventurer = 1, | ||
Adventurer_DualBlade = 2, | ||
} | ||
|
||
public static class CharacterSubJobFlagTypeExt | ||
{ | ||
/// <summary> | ||
/// Human readable string | ||
/// </summary> | ||
/// <param name="state"></param> | ||
/// <returns></returns> | ||
public static string ToReadableString(this CharacterSubJobFlagType state) | ||
{ | ||
return state.ToString().Replace("_", " "); | ||
} | ||
|
||
/// <summary> | ||
/// Converts from the string name back to enum | ||
/// </summary> | ||
/// <param name="name"></param> | ||
/// <returns></returns> | ||
public static CharacterSubJobFlagType ToEnum(this string name) | ||
{ | ||
// Try to parse the string to enum | ||
if (Enum.TryParse<CharacterSubJobFlagType>(name.Replace(" ", "_"), out CharacterSubJobFlagType result)) | ||
{ | ||
return (CharacterSubJobFlagType)result; | ||
} | ||
return CharacterSubJobFlagType.Any; | ||
} | ||
|
||
/// <summary> | ||
/// Converts from the area code value to enum type | ||
/// </summary> | ||
/// <param name="value"></param> | ||
/// <returns></returns> | ||
public static CharacterSubJobFlagType ToEnum(int value) | ||
{ | ||
if (Enum.IsDefined(typeof(CharacterSubJobFlagType), value)) | ||
{ | ||
return (CharacterSubJobFlagType)value; | ||
} | ||
else | ||
{ | ||
//Console.WriteLine($"Warning: Invalid CharacterSubJobFlagTypeExt value {value}. Defaulting to Any."); | ||
return CharacterSubJobFlagType.Any; | ||
} | ||
} | ||
} | ||
} |