Skip to content

Commit d0f02d9

Browse files
committed
Get rid of the preprocessord,
prefix s1 namespaces with S1
1 parent 7a2328e commit d0f02d9

4 files changed

Lines changed: 60 additions & 110 deletions

File tree

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#if (IL2CPPMELON)
22
using Il2CppScheduleOne.Product;
33
using S1CocaineDefinition = Il2CppScheduleOne.Product.CocaineDefinition;
4-
using Properties = Il2CppScheduleOne.Properties;
4+
using S1Properties = Il2CppScheduleOne.Properties;
55
#elif (MONOMELON || MONOBEPINEX || IL2CPPBEPINEX)
66
using ScheduleOne.Product;
77
using S1CocaineDefinition = ScheduleOne.Product.CocaineDefinition;
8-
using Properties = ScheduleOne.Properties;
8+
using S1Properties = ScheduleOne.Properties;
99
#endif
1010

1111
using System.Collections.Generic;
@@ -15,58 +15,47 @@
1515
namespace S1API.Products
1616
{
1717
/// <summary>
18-
/// Represents the definition of a cocaine product within the system.
18+
/// Defines the characteristics and behaviors of a cocaine product within the system.
1919
/// </summary>
2020
public class CocaineDefinition : ProductDefinition
2121
{
2222
/// <summary>
23-
/// INTERNAL: Strongly typed access to the CocaineDefinition within the Schedule One framework.
23+
/// Provides internal access to the CocaineDefinition type within the Schedule One system.
2424
/// </summary>
2525
internal S1CocaineDefinition S1CocaineDefinition =>
2626
CrossType.As<S1CocaineDefinition>(S1ItemDefinition);
2727

2828
/// <summary>
29-
/// Represents the definition of a Cocaine product.
29+
/// Represents the definition of a cocaine product within the system.
3030
/// </summary>
3131
internal CocaineDefinition(S1CocaineDefinition definition)
3232
: base(definition)
3333
{
3434
}
3535

3636
/// <summary>
37-
/// Creates an instance of this cocaine product with the specified quantity.
37+
/// Creates an instance of this product definition with the specified quantity.
3838
/// </summary>
39-
/// <param name="quantity">The quantity of the product to create. Defaults to 1.</param>
40-
/// <returns>An instance of the cocaine product with the specified quantity.</returns>
39+
/// <param name="quantity">The quantity of the product to instantiate. Defaults to 1 if not specified.</param>
40+
/// <returns>An <see cref="ItemInstance"/> representing the instantiated product with the specified quantity.</returns>
4141
public override ItemInstance CreateInstance(int quantity = 1) =>
4242
new ProductInstance(CrossType.As<ProductItemInstance>(
4343
S1CocaineDefinition.GetDefaultInstance(quantity)));
4444

4545
/// <summary>
46-
/// Retrieves a list of properties associated with the current cocaine product definition.
46+
/// Retrieves a list of properties associated with this product definition.
4747
/// </summary>
48-
/// <returns>A list of properties specific to the cocaine product definition.</returns>
49-
#if IL2CPPMELON
50-
public List<Properties.Property> GetProperties()
51-
#else
52-
public List<Properties.Property> GetProperties()
53-
#endif
48+
/// <returns>A list of properties for the product.</returns>
49+
public List<S1Properties.Property> GetProperties()
5450
{
55-
#if IL2CPPMELON
56-
var result = new List<Properties.Property>();
57-
#else
58-
var result = new List<Properties.Property>();
59-
#endif
51+
var result = new List<S1Properties.Property>();
6052
var list = S1CocaineDefinition?.Properties;
6153
if (list != null)
6254
{
6355
for (int i = 0; i < list.Count; i++)
64-
{
6556
result.Add(list[i]);
66-
}
6757
}
6858
return result;
6959
}
7060
}
71-
7261
}

S1API/Products/MethDefinition.cs

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,59 @@
11
#if (IL2CPPMELON)
22
using Il2CppScheduleOne.Product;
33
using S1MethDefinition = Il2CppScheduleOne.Product.MethDefinition;
4-
using Properties = Il2CppScheduleOne.Properties;
4+
using S1Properties = Il2CppScheduleOne.Properties;
55
#elif (MONOMELON || MONOBEPINEX || IL2CPPBEPINEX)
66
using ScheduleOne.Product;
77
using S1MethDefinition = ScheduleOne.Product.MethDefinition;
8-
using Properties = ScheduleOne.Properties;
8+
using S1Properties = ScheduleOne.Properties;
99
#endif
1010

1111
using System.Collections.Generic;
1212
using S1API.Internal.Utils;
1313
using S1API.Items;
14-
1514
namespace S1API.Products
1615
{
1716
/// <summary>
18-
/// Represents the definition of a Meth product in the product framework.
17+
/// Represents the definition of a meth product within the ScheduleOne product framework.
1918
/// </summary>
20-
/// <remarks>
21-
/// Provides methods for retrieving properties and creating instances of meth products. This class extends the base functionality provided by <see cref="ProductDefinition"/>.
22-
/// </remarks>
2319
public class MethDefinition : ProductDefinition
2420
{
2521
/// <summary>
26-
/// INTERNAL: Strongly typed access to S1MethDefinition, representing the Il2CppScheduleOne.Product.MethDefinition entity.
22+
/// INTERNAL: Strongly typed access to S1MethDefinition.
2723
/// </summary>
2824
internal S1MethDefinition S1MethDefinition =>
2925
CrossType.As<S1MethDefinition>(S1ItemDefinition);
3026

3127
/// <summary>
32-
/// Represents the definition of a Meth product.
28+
/// Represents the definition of a Meth product in the product framework.
3329
/// </summary>
3430
internal MethDefinition(S1MethDefinition definition)
3531
: base(definition)
3632
{
3733
}
3834

3935
/// <summary>
40-
/// Creates an instance of this meth product with a specified quantity.
36+
/// Creates an instance of this meth product with the specified quantity.
4137
/// </summary>
42-
/// <param name="quantity">The quantity of the meth product to instantiate. Defaults to 1 if not provided.</param>
43-
/// <returns>An instance of the meth product as a <see cref="ItemInstance"/>.</returns>
38+
/// <param name="quantity">The quantity of the product instance to create. Defaults to 1 if not specified.</param>
39+
/// <returns>An instance of <see cref="ItemInstance"/> representing the created meth product.</returns>
4440
public override ItemInstance CreateInstance(int quantity = 1) =>
4541
new ProductInstance(CrossType.As<ProductItemInstance>(
4642
S1MethDefinition.GetDefaultInstance(quantity)));
4743

4844
/// <summary>
4945
/// Retrieves the list of properties associated with the meth product definition.
5046
/// </summary>
51-
/// <returns>A list of properties that belong to the meth product definition.</returns>
52-
#if IL2CPPMELON
53-
public List<Properties.Property> GetProperties()
54-
#else
55-
public List<Properties.Property> GetProperties()
56-
#endif
47+
/// <returns>A list of properties defined for the meth product.</returns>
48+
public List<S1Properties.Property> GetProperties()
5749
{
58-
#if IL2CPPMELON
59-
var result = new List<Properties.Property>();
60-
#else
61-
var result = new List<Properties.Property>();
62-
#endif
50+
var result = new List<S1Properties.Property>();
6351
var list = S1MethDefinition?.Properties;
6452
if (list != null)
6553
{
6654
for (int i = 0; i < list.Count; i++)
67-
{
6855
result.Add(list[i]);
69-
}
7056
}
71-
7257
return result;
7358
}
7459
}

S1API/Products/ProductInstance.cs

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,72 @@
11
#if (IL2CPPMELON )
22
using S1Product = Il2CppScheduleOne.Product;
3-
using Properties = Il2CppScheduleOne.Properties;
3+
using S1Properties = Il2CppScheduleOne.Properties;
44
#elif (MONOMELON || MONOBEPINEX || IL2CPPBEPINEX)
55
using S1Product = ScheduleOne.Product;
66
using Properties = ScheduleOne.Properties;
77
#endif
88
using System.Collections.Generic;
99
using S1API.Internal.Utils;
10-
using ItemInstance = S1API.Items.ItemInstance;
11-
10+
using S1ItemInstance = S1API.Items.ItemInstance;
1211
namespace S1API.Products
1312
{
1413
/// <summary>
1514
/// Represents an instance of a product in the game.
1615
/// </summary>
17-
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
1821
{
1922
/// <summary>
20-
/// INTERNAL: Reference to the in-game product item instance.
23+
/// INTERNAL: Provides access to the underlying in-game product item instance.
2124
/// </summary>
2225
internal S1Product.ProductItemInstance S1ProductInstance =>
2326
CrossType.As<S1Product.ProductItemInstance>(S1ItemInstance);
2427

2528
/// <summary>
26-
/// Represents an instance of a product derived from an in-game product item 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.
2731
/// </summary>
28-
internal ProductInstance(S1Product.ProductItemInstance productInstance) : base(productInstance)
32+
internal ProductInstance(S1Product.ProductItemInstance productInstance)
33+
: base(productInstance)
2934
{
3035
}
3136

3237
/// <summary>
3338
/// Indicates whether the product instance has applied packaging.
3439
/// </summary>
35-
public bool IsPackaged =>
36-
S1ProductInstance.AppliedPackaging;
40+
public bool IsPackaged => S1ProductInstance.AppliedPackaging;
3741

3842
/// <summary>
39-
/// Represents the packaging details currently applied to the product instance, if any.
43+
/// Provides access to the packaging information applied to the product,
44+
/// represented as a specific packaging definition instance.
4045
/// </summary>
4146
public PackagingDefinition AppliedPackaging =>
4247
new PackagingDefinition(S1ProductInstance.AppliedPackaging);
4348

4449
/// <summary>
45-
/// Represents the quality tier of the product instance.
50+
/// Represents the quality level of the product instance.
4651
/// </summary>
4752
/// <remarks>
48-
/// The quality indicates the standard or grade of the product, ranging through predefined levels such as Trash, Poor, Standard, Premium, and Heavenly.
53+
/// Quality levels provide a measure of the product's grading, ranging from "Trash" to "Heavenly".
4954
/// </remarks>
5055
public Quality Quality => S1ProductInstance.Quality.ToAPI();
5156

52-
// Expose the underlying definition's properties (if S1ProductInstance.Definition is available)
53-
54-
// Add Definition property if you don't have one yet
55-
56-
#if IL2CPPMELON
57-
public IReadOnlyList<Properties.Property> Properties => Definition.Properties;
58-
public ProductDefinition Definition => new ProductDefinition(S1ProductInstance.Definition);
59-
#else
6057
/// <summary>
61-
/// Represents the collection of properties associated with the product.
58+
/// Gets the definition of the product associated with this instance.
6259
/// </summary>
63-
public IReadOnlyList<Properties.Property> Properties => Definition.Properties;
60+
public ProductDefinition Definition => new ProductDefinition(S1ProductInstance.Definition);
6461

6562
/// <summary>
66-
/// Represents the definition of a product in the game, including its core properties.
63+
/// Gets the list of properties associated with the product definition.
6764
/// </summary>
68-
public ProductDefinition Definition => new ProductDefinition(S1ProductInstance.Definition);
69-
70-
#endif
71-
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;
7271
}
7372
}

S1API/Products/WeedDefinition.cs

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#if (IL2CPPMELON)
22
using Il2CppScheduleOne.Product;
33
using S1WeedDefinition = Il2CppScheduleOne.Product.WeedDefinition;
4-
using Properties = Il2CppScheduleOne.Properties;
4+
using S1Properties = Il2CppScheduleOne.Properties;
55
#elif (MONOMELON || MONOBEPINEX || IL2CPPBEPINEX)
66
using ScheduleOne.Product;
77
using S1WeedDefinition = ScheduleOne.Product.WeedDefinition;
8-
using Properties = ScheduleOne.Properties;
8+
using S1Properties = ScheduleOne.Properties;
99
#endif
1010

1111
using S1API.Internal.Utils;
@@ -15,29 +15,19 @@
1515
namespace S1API.Products
1616
{
1717
/// <summary>
18-
/// Represents a specific type of weed product definition. This class extends the functionality of
19-
/// <see cref="ProductDefinition"/> to include details specific to weed products.
18+
/// Represents a specific type of weed product definition.
2019
/// </summary>
21-
/// <remarks>
22-
/// This class provides methods and properties to work with weed-related product definitions,
23-
/// including creating product instances and accessing weed-specific properties.
24-
/// </remarks>
2520
public class WeedDefinition : ProductDefinition
2621
{
2722
/// <summary>
28-
/// Represents the definition of a weed product in the ScheduleOne API.
29-
/// Provides access to underlying data and functionalities specific to weed products.
23+
/// INTERNAL: Strongly typed reference to Schedule One's WeedDefinition.
3024
/// </summary>
3125
internal S1WeedDefinition S1WeedDefinition =>
3226
CrossType.As<S1WeedDefinition>(S1ItemDefinition);
3327

3428
/// <summary>
35-
/// Represents a specific type of product definition for weed products in the API.
29+
/// Represents a specific type of weed product definition.
3630
/// </summary>
37-
/// <remarks>
38-
/// This class acts as a wrapper for `Il2CppScheduleOne.Product.WeedDefinition`,
39-
/// providing additional functionality and a specific type for handling weed items.
40-
/// </remarks>
4131
internal WeedDefinition(S1WeedDefinition definition)
4232
: base(definition)
4333
{
@@ -47,37 +37,24 @@ internal WeedDefinition(S1WeedDefinition definition)
4737
/// Creates an instance of the product with the specified quantity.
4838
/// </summary>
4939
/// <param name="quantity">The quantity of the product to create. Defaults to 1 if not specified.</param>
50-
/// <returns>An instance of <see cref="ItemInstance"/> representing the created product.</returns>
40+
/// <returns>An <see cref="ItemInstance"/> representing the created product instance with the specified quantity.</returns>
5141
public override ItemInstance CreateInstance(int quantity = 1) =>
5242
new ProductInstance(CrossType.As<ProductItemInstance>(
5343
S1WeedDefinition.GetDefaultInstance(quantity)));
5444

5545
/// <summary>
56-
/// Gets a list of properties associated with the current weed definition.
46+
/// Retrieves a list of properties associated with this weed definition.
5747
/// </summary>
58-
/// <returns>
59-
/// A list of properties of type Il2CppScheduleOne.Properties.Property
60-
/// associated with the weed definition. If no properties are found,
61-
/// an empty list is returned.
62-
/// </returns>
63-
#if IL2CPPMELON
64-
public List<Properties.Property> GetProperties()
65-
#else
66-
public List<Properties.Property> GetProperties()
67-
#endif
48+
/// <returns>A list of properties of type <c>S1Properties.Property</c> that are linked with the current weed definition, or an empty list if none are found.</returns>
49+
public List<S1Properties.Property> GetProperties()
6850
{
69-
#if IL2CPPMELON
70-
var result = new List<Properties.Property>();
71-
#else
72-
var result = new List<Properties.Property>();
73-
#endif
51+
var result = new List<S1Properties.Property>();
7452
var list = S1WeedDefinition?.Properties;
53+
7554
if (list != null)
7655
{
7756
for (int i = 0; i < list.Count; i++)
78-
{
7957
result.Add(list[i]);
80-
}
8158
}
8259

8360
return result;

0 commit comments

Comments
 (0)