Gun.cs

A LoadoutItem subclass representing a gun, it defines charm and gem attachment points and tracks currently spawned charm and gem GameObjects.

using Sandbox;

public class Gun : LoadoutItem
{
	[Property] public List<GameObject> CharmAnchors { get; set; }
	[Property] public List<GameObject> GemSlots { get; set; }

	/// <summary>
	/// The currently spawned charm GameObjects on this gun (one per charm slot).
	/// Managed by Player.SpawnCharmOnGunObj / Player.SwapCharmRpc.
	/// </summary>
	public List<GameObject> CurrentCharms { get; set; } = new();

	public List<GameObject> GetCharmAnchors() => CharmAnchors ?? [];

	/// <summary>
	/// The currently spawned gem GameObjects, one per filled slot.
	/// Managed by Player.SpawnGemsOnGunObj / Player.SwapGemsRpc.
	/// </summary>
	public List<GameObject> CurrentGems { get; set; } = new();
}