|
1 | | -#if (IL2CPPMELON) |
| 1 | +#if (IL2CPPMELON ) |
2 | 2 | using S1Product = Il2CppScheduleOne.Product; |
| 3 | +using S1Properties = Il2CppScheduleOne.Properties; |
3 | 4 | #elif (MONOMELON || MONOBEPINEX || IL2CPPBEPINEX) |
4 | 5 | using S1Product = ScheduleOne.Product; |
| 6 | +using S1Properties = ScheduleOne.Properties; |
5 | 7 | #endif |
6 | | - |
| 8 | +using System.Collections.Generic; |
7 | 9 | using S1API.Internal.Utils; |
8 | | -using S1API.Items; |
9 | | - |
| 10 | +using S1ItemInstance = S1API.Items.ItemInstance; |
10 | 11 | namespace S1API.Products |
11 | 12 | { |
12 | 13 | /// <summary> |
13 | 14 | /// Represents an instance of a product in the game. |
14 | 15 | /// </summary> |
15 | | - public class ProductInstance : ItemInstance |
| 16 | + /// <remarks> |
| 17 | + /// This class defines specific properties and behaviors for a product instance, |
| 18 | + /// such as quality, packaging, and definition, derived from the S1API's item instance structure. |
| 19 | + /// </remarks> |
| 20 | + public class ProductInstance : S1ItemInstance |
16 | 21 | { |
17 | 22 | /// <summary> |
18 | | - /// INTERNAL: The stored reference to the in-game product instance. |
| 23 | + /// INTERNAL: Provides access to the underlying in-game product item instance. |
19 | 24 | /// </summary> |
20 | 25 | internal S1Product.ProductItemInstance S1ProductInstance => |
21 | 26 | CrossType.As<S1Product.ProductItemInstance>(S1ItemInstance); |
22 | 27 |
|
23 | 28 | /// <summary> |
24 | | - /// INTERNAL: Creates a product instance from the in-game product instance. |
| 29 | + /// Represents an instance of a product, derived from a specific in-game product item instance, |
| 30 | + /// with additional properties for packaging, quality, and product definition. |
25 | 31 | /// </summary> |
26 | | - /// <param name="productInstance"></param> |
27 | | - internal ProductInstance(S1Product.ProductItemInstance productInstance) : base(productInstance) { } |
| 32 | + internal ProductInstance(S1Product.ProductItemInstance productInstance) |
| 33 | + : base(productInstance) |
| 34 | + { |
| 35 | + } |
28 | 36 |
|
29 | 37 | /// <summary> |
30 | | - /// Whether this product is currently packaged or not. |
| 38 | + /// Indicates whether the product instance has applied packaging. |
31 | 39 | /// </summary> |
32 | | - public bool IsPackaged => |
33 | | - S1ProductInstance.AppliedPackaging; |
| 40 | + public bool IsPackaged => S1ProductInstance.AppliedPackaging; |
34 | 41 |
|
35 | 42 | /// <summary> |
36 | | - /// The type of packaging applied to this product. |
| 43 | + /// Provides access to the packaging information applied to the product, |
| 44 | + /// represented as a specific packaging definition instance. |
37 | 45 | /// </summary> |
38 | 46 | public PackagingDefinition AppliedPackaging => |
39 | 47 | new PackagingDefinition(S1ProductInstance.AppliedPackaging); |
| 48 | + |
| 49 | + /// <summary> |
| 50 | + /// Represents the quality level of the product instance. |
| 51 | + /// </summary> |
| 52 | + /// <remarks> |
| 53 | + /// Quality levels provide a measure of the product's grading, ranging from "Trash" to "Heavenly". |
| 54 | + /// </remarks> |
| 55 | + public Quality Quality => S1ProductInstance.Quality.ToAPI(); |
| 56 | + |
| 57 | + /// <summary> |
| 58 | + /// Gets the definition of the product associated with this instance. |
| 59 | + /// </summary> |
| 60 | + public ProductDefinition Definition => new ProductDefinition(S1ProductInstance.Definition); |
| 61 | + |
| 62 | + /// <summary> |
| 63 | + /// Gets the list of properties associated with the product definition. |
| 64 | + /// </summary> |
| 65 | + /// <remarks> |
| 66 | + /// This property provides an unmodifiable list of properties associated |
| 67 | + /// with the underlying product definition. Each property represents |
| 68 | + /// a specific characteristic or behavior of the corresponding product. |
| 69 | + /// </remarks> |
| 70 | + public IReadOnlyList<S1Properties.Property> Properties => Definition.Properties; |
40 | 71 | } |
41 | 72 | } |
0 commit comments