Class AreaBonusComponent
Component that emits bonuses to nearby crafting tables within Radius.
Discovered by Sources() via spatial query — yields this component directly
(not the parent WorldObject) so only area-specific bonuses apply, not plugin module bonuses.
Implements IHasBonuses as a leaf source — bonuses are defined at setup time.
Inheritance
System.Object
AreaBonusComponent
Implements
System.ComponentModel.INotifyPropertyChanged
Assembly: Eco.Gameplay.dll
Syntax
public class AreaBonusComponent : WorldObjectComponent, ILinkable, IOwned, IController, IViewController, IHasUniversalID, IHasSerializableID, IRPCAuthChecks, INotifyPropertyChanged, IThreadSafeSubscriptions, ISubscriptions<ThreadSafeSubscriptions>, ISubscriptions, IHasInteractions, IHasBonuses
Constructors
AreaBonusComponent()
Declaration
public AreaBonusComponent()
AreaBonusComponent(Single)
Declaration
public AreaBonusComponent(float radius)
Parameters
| Type |
Name |
Description |
| System.Single |
radius |
|
Properties
Bonuses
Declaration
public IEnumerable<Bonus> Bonuses { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.IEnumerable<Bonus> |
|
BonusList
Bonuses emitted by this area effect building. Populated during setup.
Declaration
public List<Bonus> BonusList { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.List<Bonus> |
|
Radius
Maximum range (in blocks) at which this component's bonuses apply to nearby crafting tables.
Declaration
public float Radius { get; }
Property Value
| Type |
Description |
| System.Single |
|
Methods
DiscoverNearby(WorldObject, User)
Discover all AreaBonusComponents within range of the context position.
Prefers contextWorldObject position (crafting table); currently requires it to be non-null.
Excludes the context's own WorldObject to avoid double-sourcing.
Declaration
public static IEnumerable<AreaBonusComponent> DiscoverNearby(WorldObject contextWorldObject, User contextSource)
Parameters
Returns
Initialize(Single)
Declaration
public void Initialize(float radius)
Parameters
| Type |
Name |
Description |
| System.Single |
radius |
|
Implements
System.ComponentModel.INotifyPropertyChanged
Extension Methods