Game.Buildings.ModifierRadiusCombineMode
Assembly: Assembly-CSharp
Namespace: Game.Buildings
Type: enum
Base: System.Enum
Summary: Specifies how multiple modifier radii are combined when more than one modifier affects a building or area. Use this enum to determine whether radii should be merged by taking the maximal radius or by summing (additive) them. Commonly used in systems that calculate coverage, influence, or effect ranges from multiple sources.
Fields
-
Maximal
Represents combining radii by taking the largest (maximum) radius among all modifiers. Use this when overlapping modifiers should not extend range beyond the single largest contributor. -
Additive
Represents combining radii by summing all modifier radii. Use this when multiple modifiers should increase the total effective radius.
Properties
- None.
This enum has no properties beyond the standard System.Enum members (ToString, HasFlag, etc.).
Constructors
- None.
As an enum, instances are the defined named values; there are no public constructors.
Methods
- None specific to this enum.
Standard System.Enum and System.ValueType methods are available (e.g., ToString(), GetHashCode()).
Usage Example
using Game.Buildings;
public static float CombineRadii(float r1, float r2, ModifierRadiusCombineMode mode)
{
return mode == ModifierRadiusCombineMode.Additive ? (r1 + r2) : MathF.Max(r1, r2);
}
// Example usage:
ModifierRadiusCombineMode mode = ModifierRadiusCombineMode.Maximal;
float combined = CombineRadii(10f, 6f, mode); // combined == 10f when Maximal
mode = ModifierRadiusCombineMode.Additive;
combined = CombineRadii(10f, 6f, mode); // combined == 16f when Additive