Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Bottom.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using S1API.Entities.Appearances.Base;
using System.Reflection;

namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
/// The Bottom index in AvatarSettings::AccessorySettings
/// </summary>
public class Bottom : BaseAccessoryAppearance
{
public const string LongSkirt = "Avatar/Accessories/Bottom/LongSkirt/LongSkirt";
public const string MediumSkirt = "Avatar/Accessories/Bottom/MediumSkirt/MediumSkirt";
}
}
16 changes: 16 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Chest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using S1API.Entities.Appearances.Base;

namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
/// The Chest index in AvatarSettings::AccessorySettings
/// </summary>
public class Chest : BaseAccessoryAppearance
{
public const string Blazer = "Avatar/Accessories/Chest/Blazer/Blazer";
public const string BulletProofVest = "Avatar/Accessories/Chest/BulletProofVest/BulletProofVest";
public const string BulletProofVestPolice = "Avatar/Accessories/Chest/BulletProofVest/BulletProofVest_Police";
public const string CollarJacket = "Avatar/Accessories/Chest/CollarJacket/CollarJacket";
public const string OpenVest = "Avatar/Accessories/Chest/OpenVest/OpenVest";
}
}
16 changes: 16 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Feet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using S1API.Entities.Appearances.Base;

namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
/// The Feet index in AvatarSettings::AccessorySettings
/// </summary>
public class Feet : BaseAccessoryAppearance
{
public const string CombatShoes = "Avatar/Accessories/Feet/CombatShoes/CombatShoes";
public const string DressShoes = "Avatar/Accessories/Feet/DressShoes/DressShoes";
public const string Flats = "Avatar/Accessories/Feet/Flats/Flats";
public const string Sandals = "Avatar/Accessories/Feet/Sandals/Sandals";
public const string Sneakers = "Avatar/Accessories/Feet/Sneakers/Sneakers";
}
}
12 changes: 12 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Hands.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using S1API.Entities.Appearances.Base;

namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
/// The Hands index in AvatarSettings::AccessorySettings
/// </summary>
public class Hands : BaseAccessoryAppearance
{
public const string Polex = "Avatar/Accessories/Hands/Polex/Polex";
}
}
25 changes: 25 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Head.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using S1API.Entities.Appearances.Base;

namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
/// The Head index in AvatarSettings::AccessorySettings
/// </summary>
public class Head : BaseAccessoryAppearance
{
public const string BucketHat = "Avatar/Accessories/Head/BucketHat/BucketHat";
public const string Cap = "Avatar/Accessories/Head/Cap/Cap";
public const string CapFastFood = "Avatar/Accessories/Head/Cap/Cap_FastFood";
public const string ChefHat = "Avatar/Accessories/Head/ChefHat/ChefHat";
public const string CowboyHat = "Avatar/Accessories/Head/Cowboy/CowboyHat";
public const string FlatCap = "Avatar/Accessories/Head/FlatCap/FlatCap";
public const string LegendSunglasses = "Avatar/Accessories/Head/LegendSunglasses/LegendSunglasses";
public const string Oakleys = "Avatar/Accessories/Head/Oakleys/Oakleys";
public const string PoliceCap = "Avatar/Accessories/Head/PoliceCap/PoliceCap";
public const string PorkpieHat = "Avatar/Accessories/Head/PorkpieHat/PorkpieHat";
public const string RectangleFrameGlasses = "Avatar/Accessories/Head/RectangleFrameGlasses/RectangleFrameGlasses";
public const string Respirator = "Avatar/Accessories/Head/Respirator/Respirator";
public const string SaucePan = "Avatar/Accessories/Head/SaucePan/SaucePan";
public const string SmallRoundGlasses = "Avatar/Accessories/Head/SmallRoundGlasses/SmallRoundGlasses";
}
}
12 changes: 12 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Neck.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using S1API.Entities.Appearances.Base;

namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
/// The Neck index in AvatarSettings::AccessorySettings
/// </summary>
public class Neck : BaseAccessoryAppearance
{
public const string GoldChain = "Avatar/Accessories/Neck/GoldChain/GoldChain";
}
}
16 changes: 16 additions & 0 deletions S1API/Entities/Appearances/AccessoryFields/Waist.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using S1API.Entities.Appearances.Base;

namespace S1API.Entities.Appearances.AccessoryFields
{
/// <summary>
/// The Waist index in AvatarSettings::AccessorySettings
/// </summary>
public class Waist : BaseAccessoryAppearance
{
public const string Apron = "Avatar/Accessories/Waist/Apron/Apron";
public const string Belt = "Avatar/Accessories/Waist/Belt/Belt";
public const string HazmatSuit = "Avatar/Accessories/Waist/HazmatSuit/HazmatSuit";
public const string PoliceBelt = "Avatar/Accessories/Waist/PoliceBelt/PoliceBelt";
public const string PriestGown = "Avatar/Accessories/Neck/PriestGown/PriestGown";
}
}
45 changes: 45 additions & 0 deletions S1API/Entities/Appearances/Base/BaseAccessoryAppearance.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Reflection;

namespace S1API.Entities.Appearances.Base
{
/// <summary>
/// The base accessory appearance class
/// </summary>
/// <remarks>This is used to track the properties within the AvatarSettings</remarks>
public class BaseAccessoryAppearance
{
private static readonly Dictionary<Type, List<string>> _constCache = new Dictionary<Type, List<string>>();

/// <summary>
/// Retrieves and caches all public <c>const string</c> fields defined in the specified type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">
/// The type from which to retrieve constant string fields. Must inherit from <see cref="BaseAccessoryAppearance"/>.
/// </typeparam>
/// <returns>
/// A list of constant string values defined in the type <typeparamref name="T"/>.
/// </returns>
/// <remarks>
/// Uses reflection to gather constants and caches them for future calls to improve performance.
/// </remarks>
internal static List<string> GetConstPaths<T>() where T : BaseAccessoryAppearance
{
var type = typeof(T);
if (_constCache.TryGetValue(type, out var cached))
return cached;

var consts = new List<string>();
var fields = type.GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
foreach (var field in fields)
{
if (field is { IsLiteral: true, IsInitOnly: false } && field.FieldType == typeof(string))
consts.Add((string)field.GetRawConstantValue());
}

_constCache[type] = consts;
return consts;
}
}
}
45 changes: 45 additions & 0 deletions S1API/Entities/Appearances/Base/BaseAppearance.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Reflection;

namespace S1API.Entities.Appearances.Base
{
/// <summary>
/// The base appearance class
/// </summary>
/// <remarks>This is used to track the properties within the AvatarSettings</remarks>
public class BaseAppearance
{
private static readonly Dictionary<Type, List<string>> _constCache = new Dictionary<Type, List<string>>();

/// <summary>
/// Retrieves and caches all public <c>const string</c> fields defined in the specified type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">
/// The type from which to retrieve constant string fields. Must inherit from <see cref="BaseAppearance"/>.
/// </typeparam>
/// <returns>
/// A list of constant string values defined in the type <typeparamref name="T"/>.
/// </returns>
/// <remarks>
/// Uses reflection to gather constants and caches them for future calls to improve performance.
/// </remarks>
internal static List<string> GetConstPaths<T>() where T : BaseAppearance
{
var type = typeof(T);
if (_constCache.TryGetValue(type, out var cached))
return cached;

var consts = new List<string>();
var fields = type.GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
foreach (var field in fields)
{
if (field is { IsLiteral: true, IsInitOnly: false } && field.FieldType == typeof(string))
consts.Add((string)field.GetRawConstantValue());
}

_constCache[type] = consts;
return consts;
}
}
}
45 changes: 45 additions & 0 deletions S1API/Entities/Appearances/Base/BaseBodyAppearance.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Reflection;

namespace S1API.Entities.Appearances.Base
{
/// <summary>
/// The base body appearance class
/// </summary>
/// <remarks>This is used to track the properties within the AvatarSettings</remarks>
public class BaseBodyAppearance
{
private static readonly Dictionary<Type, List<string>> _constCache = new Dictionary<Type, List<string>>();

/// <summary>
/// Retrieves and caches all public <c>const string</c> fields defined in the specified type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">
/// The type from which to retrieve constant string fields. Must inherit from <see cref="BaseBodyAppearance"/>.
/// </typeparam>
/// <returns>
/// A list of constant string values defined in the type <typeparamref name="T"/>.
/// </returns>
/// <remarks>
/// Uses reflection to gather constants and caches them for future calls to improve performance.
/// </remarks>
internal static List<string> GetConstPaths<T>() where T : BaseBodyAppearance
{
var type = typeof(T);
if (_constCache.TryGetValue(type, out var cached))
return cached;

var consts = new List<string>();
var fields = type.GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
foreach (var field in fields)
{
if (field is { IsLiteral: true, IsInitOnly: false } && field.FieldType == typeof(string))
consts.Add((string)field.GetRawConstantValue());
}

_constCache[type] = consts;
return consts;
}
}
}
45 changes: 45 additions & 0 deletions S1API/Entities/Appearances/Base/BaseFaceAppearance.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Reflection;

namespace S1API.Entities.Appearances.Base
{
/// <summary>
/// The base face appearance class
/// </summary>
/// <remarks>This is used to track the properties within the AvatarSettings</remarks>
public class BaseFaceAppearance
{
private static readonly Dictionary<Type, List<string>> _constCache = new Dictionary<Type, List<string>>();

/// <summary>
/// Retrieves and caches all public <c>const string</c> fields defined in the specified type <typeparamref name="T"/>.
/// </summary>
/// <typeparam name="T">
/// The type from which to retrieve constant string fields. Must inherit from <see cref="BaseFaceAppearance"/>.
/// </typeparam>
/// <returns>
/// A list of constant string values defined in the type <typeparamref name="T"/>.
/// </returns>
/// <remarks>
/// Uses reflection to gather constants and caches them for future calls to improve performance.
/// </remarks>
internal static List<string> GetConstPaths<T>() where T : BaseFaceAppearance
{
var type = typeof(T);
if (_constCache.TryGetValue(type, out var cached))
return cached;

var consts = new List<string>();
var fields = type.GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
foreach (var field in fields)
{
if (field is { IsLiteral: true, IsInitOnly: false } && field.FieldType == typeof(string))
consts.Add((string)field.GetRawConstantValue());
}

_constCache[type] = consts;
return consts;
}
}
}
16 changes: 16 additions & 0 deletions S1API/Entities/Appearances/BodyLayerFields/Pants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using S1API.Entities.Appearances.Base;

namespace S1API.Entities.Appearances.BodyLayerFields
{
/// <summary>
/// The Bottom index in AvatarSettings
/// </summary>
public class Pants : BaseBodyAppearance
{
public const string CargoPants = "Avatar/Layers/Bottom/CargoPants";
public const string FemaleUnderwear = "Avatar/Layers/Bottom/FemaleUnderwear";
public const string Jeans = "Avatar/Layers/Bottom/Jeans";
public const string Jorts = "Avatar/Layers/Bottom/Jorts";
public const string MaleUnderwear = "Avatar/Layers/Bottom/MaleUnderwear";
}
}
24 changes: 24 additions & 0 deletions S1API/Entities/Appearances/BodyLayerFields/Shirt.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using S1API.Entities.Appearances.Base;

namespace S1API.Entities.Appearances.BodyLayerFields
{
/// <summary>
/// The Top index in AvatarSettings
/// </summary>
public class Shirts : BaseBodyAppearance
{
public const string Buttonup = "Avatar/Layers/Top/Buttonup";
public const string ChestHair = "Avatar/Layers/Top/ChestHair1";
public const string FastFoodTShirt = "Avatar/Layers/Top/FastFood T-Shirt";
public const string FlannelButtonUp = "Avatar/Layers/Top/FlannelButtonUp";
public const string GasStationTShirt = "Avatar/Layers/Top/GasStation T-Shirt";
public const string HazmatSuit = "Avatar/Layers/Top/HazmatSuit";
public const string Nipples = "Avatar/Layers/Top/Nipples";
public const string Overalls = "Avatar/Layers/Top/Overalls";
public const string RolledButtonUp = "Avatar/Layers/Top/RolledButtonUp";
public const string TShirt = "Avatar/Layers/Top/T-Shirt";
public const string TuckedTShirt = "Avatar/Layers/Top/Tucked T-Shirt";
public const string UpperBodyTattoos = "Avatar/Layers/Top/UpperBodyTattoos";
public const string VNeck = "Avatar/Layers/Top/V-Neck";
}
}
10 changes: 10 additions & 0 deletions S1API/Entities/Appearances/CustomizationFields/EyeBallTint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using S1API.Entities.Appearances.Base;

namespace S1API.Entities.Appearances.CustomizationFields
{
/// <summary>
/// The EyeBallTint field in AvatarSettings
/// </summary>
/// <remarks>Is a Color type</remarks>
public class EyeBallTint : BaseAppearance { }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using S1API.Entities.Appearances.Base;

namespace S1API.Entities.Appearances.CustomizationFields
{
/// <summary>
/// The LeftEyeRestingState field in AvatarSettings
/// </summary>
/// <remarks>Is a (float, float) type</remarks>
public class EyeLidRestingStateLeft : BaseAppearance { }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using S1API.Entities.Appearances.Base;

namespace S1API.Entities.Appearances.CustomizationFields
{
/// <summary>
/// The RightEyeRestingState field in AvatarSettings
/// </summary>
/// <remarks>Is a (float, float) type</remarks>
public class EyeLidRestingStateRight : BaseAppearance { }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using S1API.Entities.Appearances.Base;

namespace S1API.Entities.Appearances.CustomizationFields
{
/// <summary>
/// The EyebrowRestingAngle field in AvatarSettings
/// </summary>
/// <remarks>Is a float type</remarks>
public class EyebrowRestingAngle : BaseAppearance { }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using S1API.Entities.Appearances.Base;

namespace S1API.Entities.Appearances.CustomizationFields
{
/// <summary>
/// The EyebrowRestingHeight field in AvatarSettings
/// </summary>
/// <remarks>Is a float type</remarks>
public class EyebrowRestingHeight : BaseAppearance { }
}
Loading
Loading