-
Notifications
You must be signed in to change notification settings - Fork 34
Products #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Products #70
Changes from 6 commits
d8180a0
adf3cca
2051d7f
f134b62
492a4ba
0a3c70c
36e845c
394c586
f0cbcd7
63899d1
373744d
7a2328e
d0f02d9
641f48f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| #if IL2CPPBEPINEX || IL2CPPMELON | ||
| using InternalQuality = Il2CppScheduleOne.ItemFramework.EQuality; | ||
| #else | ||
| using InternalQuality = ScheduleOne.ItemFramework.EQuality; | ||
| #endif | ||
| namespace S1API.Products | ||
| { | ||
| /// <summary> | ||
| /// Represents the quality levels for items. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// This enumeration defines various quality tiers that items can belong to. Each tier represents a specific | ||
| /// standard or grade, ranging from the lowest to the highest. | ||
| /// </remarks> | ||
| public enum Quality | ||
| { | ||
| /// <summary> | ||
| /// Represents the lowest quality level, indicating an item of no value or unusable condition. | ||
| /// </summary> | ||
| Trash = 0, | ||
|
|
||
| /// <summary> | ||
| /// Represents a quality level that is below standard but better than trash-quality. | ||
| /// </summary> | ||
| Poor = 1, | ||
|
|
||
| /// <summary> | ||
| /// Represents a standard level of quality in the predefined quality enumeration. | ||
| /// Typically used to indicate an average or commonly acceptable quality level. | ||
| /// </summary> | ||
| Standard = 2, | ||
|
|
||
| /// <summary> | ||
| /// Represents a higher-tier quality level compared to lower | ||
| Premium = 3, | ||
|
Check warning on line 35 in S1API/Products/Quality.cs
|
||
MaxtorCoder marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /// <summary> | ||
| /// Represents the highest level of quality, denoted as "Heavenly". | ||
| Heavenly = 4 | ||
|
Check warning on line 39 in S1API/Products/Quality.cs
|
||
MaxtorCoder marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| /// <summary> | ||
| /// Provides extension methods for converting between <see cref="Il2CppScheduleOne.ItemFramework.EQuality"/> and | ||
| /// <see cref="S1API.Products.Quality"/> enumerations. | ||
| /// </summary> | ||
| internal static class QualityExtensions | ||
| { | ||
| /// <summary> | ||
| /// Converts an instance of <see cref="Il2CppScheduleOne.ItemFramework.EQuality"/> to its corresponding | ||
| /// <see cref="S1API.Products.Quality"/> representation. | ||
| /// </summary> | ||
| /// <param name="quality">The <see cref="Il2CppScheduleOne.ItemFramework.EQuality"/> instance to convert.</param> | ||
| /// <returns>A <see cref="S1API.Products.Quality"/> value that represents the converted quality.</returns> | ||
| internal static Quality ToAPI(this InternalQuality quality) | ||
| { | ||
| return quality switch | ||
| { | ||
| InternalQuality.Trash => Quality.Trash, | ||
| InternalQuality.Poor => Quality.Poor, | ||
| InternalQuality.Standard => Quality.Standard, | ||
| InternalQuality.Premium => Quality.Premium, | ||
| InternalQuality.Heavenly => Quality.Heavenly, | ||
| _ => Quality.Trash, | ||
| }; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Converts an instance of the <see cref="Quality"/> enum to its corresponding | ||
| /// <see cref="InternalQuality"/> enum representation. | ||
| /// </summary> | ||
| /// <param name="quality">The <see cref="Quality"/> enum value to convert.</param> | ||
| /// <returns>The corresponding <see cref="InternalQuality"/> enum value.</returns> | ||
| internal static InternalQuality ToInternal(this Quality quality) | ||
| { | ||
| return quality switch | ||
| { | ||
| Quality.Trash => InternalQuality.Trash, | ||
| Quality.Poor => InternalQuality.Poor, | ||
| Quality.Standard => InternalQuality.Standard, | ||
| Quality.Premium => InternalQuality.Premium, | ||
| Quality.Heavenly => InternalQuality.Heavenly, | ||
| _ => InternalQuality.Trash, | ||
| }; | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.