mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-20 06:19:05 -04:00
https://files.facepunch.com/antopilo/1b0311b1/sbox-dev_Ghn3TRf8eM.mp4 https://files.facepunch.com/antopilo/1b0311b1/sbox-dev_yALD2nMaPw.mp4
33 lines
722 B
C#
33 lines
722 B
C#
namespace Sandbox.Clutter;
|
|
|
|
/// <summary>
|
|
/// Immutable settings for clutter generation.
|
|
/// Used to detect changes and configure the grid system.
|
|
/// </summary>
|
|
readonly record struct ClutterSettings
|
|
{
|
|
public int RandomSeed { get; init; }
|
|
public ClutterDefinition Clutter { get; init; }
|
|
|
|
public ClutterSettings( int randomSeed, ClutterDefinition definition )
|
|
{
|
|
RandomSeed = randomSeed;
|
|
Clutter = definition;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Validates that settings are ready for clutter generation.
|
|
/// </summary>
|
|
public bool IsValid => Clutter != null;
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return HashCode.Combine(
|
|
Clutter.TileSize,
|
|
Clutter.TileRadius,
|
|
RandomSeed,
|
|
Clutter?.GetHashCode() ?? 0
|
|
);
|
|
}
|
|
}
|