|
8 | 8 |
|
9 | 9 | using S1API.Internal.Utils; |
10 | 10 | using S1API.Items; |
| 11 | +using System.Collections.Generic; |
11 | 12 |
|
12 | 13 | namespace S1API.Products |
13 | 14 | { |
14 | 15 | /// <summary> |
15 | | - /// Represents the definition of a Weed product. |
| 16 | + /// Represents a specific type of weed product definition. This class extends the functionality of |
| 17 | + /// <see cref="ProductDefinition"/> to include details specific to weed products. |
16 | 18 | /// </summary> |
| 19 | + /// <remarks> |
| 20 | + /// This class provides methods and properties to work with weed-related product definitions, |
| 21 | + /// including creating product instances and accessing weed-specific properties. |
| 22 | + /// </remarks> |
17 | 23 | public class WeedDefinition : ProductDefinition |
18 | 24 | { |
19 | 25 | /// <summary> |
20 | | - /// INTERNAL: Strongly typed access to the WeedDefinition. |
| 26 | + /// Represents the definition of a weed product in the ScheduleOne API. |
| 27 | + /// Provides access to underlying data and functionalities specific to weed products. |
21 | 28 | /// </summary> |
22 | 29 | internal S1WeedDefinition S1WeedDefinition => |
23 | 30 | CrossType.As<S1WeedDefinition>(S1ItemDefinition); |
24 | 31 |
|
25 | | - |
26 | 32 | /// <summary> |
27 | | - /// Creates a new weed product definition. |
| 33 | + /// Represents a specific type of product definition for weed products in the API. |
28 | 34 | /// </summary> |
29 | | - /// <param name="definition">The original in-game weed definition.</param> |
| 35 | + /// <remarks> |
| 36 | + /// This class acts as a wrapper for `Il2CppScheduleOne.Product.WeedDefinition`, |
| 37 | + /// providing additional functionality and a specific type for handling weed items. |
| 38 | + /// </remarks> |
30 | 39 | internal WeedDefinition(S1WeedDefinition definition) |
31 | | - : base(definition) { } |
| 40 | + : base(definition) |
| 41 | + { |
| 42 | + } |
32 | 43 |
|
33 | 44 | /// <summary> |
34 | | - /// Creates an instance of this weed product. |
| 45 | + /// Creates an instance of the product with the specified quantity. |
35 | 46 | /// </summary> |
| 47 | + /// <param name="quantity">The quantity of the product to create. Defaults to 1 if not specified.</param> |
| 48 | + /// <returns>An instance of <see cref="ItemInstance"/> representing the created product.</returns> |
36 | 49 | public override ItemInstance CreateInstance(int quantity = 1) => |
37 | 50 | new ProductInstance(CrossType.As<ProductItemInstance>( |
38 | 51 | S1WeedDefinition.GetDefaultInstance(quantity))); |
| 52 | + |
| 53 | + /// <summary> |
| 54 | + /// Gets a list of properties associated with the current weed definition. |
| 55 | + /// </summary> |
| 56 | + /// <returns> |
| 57 | + /// A list of properties of type Il2CppScheduleOne.Properties.Property |
| 58 | + /// associated with the weed definition. If no properties are found, |
| 59 | + /// an empty list is returned. |
| 60 | + /// </returns> |
| 61 | + public List<Il2CppScheduleOne.Properties.Property> GetProperties() |
| 62 | + { |
| 63 | + var result = new List<Il2CppScheduleOne.Properties.Property>(); |
| 64 | + var list = S1WeedDefinition?.Properties; |
| 65 | + if (list != null) |
| 66 | + { |
| 67 | + for (int i = 0; i < list.Count; i++) |
| 68 | + { |
| 69 | + result.Add(list[i]); |
| 70 | + } |
| 71 | + } |
| 72 | + |
| 73 | + return result; |
| 74 | + } |
39 | 75 | } |
40 | 76 | } |
0 commit comments