Empeld
Empeld plugin documentation.
essentials.Systems.Triggers.WorldAreaTrigger Class Reference

A trigger that invokes when a certain area and predicate is matched on a world event More...

Inheritance diagram for essentials.Systems.Triggers.WorldAreaTrigger:
essentials.Systems.Triggers.ITrigger

Public Member Functions

 WorldAreaTrigger (Volume volume, Func< IWorldReadonlyBlock, bool > predicate=null)
 
 WorldAreaTrigger (Vector3i pt, Size3i size, Func< IWorldReadonlyBlock, bool > predicate=null)
 
 WorldAreaTrigger (Vector3i pt, Func< IWorldReadonlyBlock, bool > predicate=null)
 
void Dispose ()
 

Protected Member Functions

 WorldAreaTrigger ()
 

Properties

Action< ITriggerTriggered
 
int TriggerCount [get]
 
- Properties inherited from essentials.Systems.Triggers.ITrigger
int TriggerCount [get]
 

Additional Inherited Members

- Events inherited from essentials.Systems.Triggers.ITrigger
Action< ITriggerTriggered
 

Detailed Description

A trigger that invokes when a certain area and predicate is matched on a world event

Constructor & Destructor Documentation

◆ WorldAreaTrigger() [1/4]

essentials.Systems.Triggers.WorldAreaTrigger.WorldAreaTrigger ( )
protected
22  {
23  this.InjectDependencies();
24  _world.OnBlockUpdate += HandleBlockUpdate;
25  }
Action< IWorldBlock > OnBlockUpdate
Occurs when a block in the world has updated
Definition: IWorld.cs:43

◆ WorldAreaTrigger() [2/4]

essentials.Systems.Triggers.WorldAreaTrigger.WorldAreaTrigger ( Volume  volume,
Func< IWorldReadonlyBlock, bool >  predicate = null 
)
28  :this()
29  {
30  _volume = volume;
31  _predicate = predicate;
32  }

◆ WorldAreaTrigger() [3/4]

essentials.Systems.Triggers.WorldAreaTrigger.WorldAreaTrigger ( Vector3i  pt,
Size3i  size,
Func< IWorldReadonlyBlock, bool >  predicate = null 
)
35  :this(new Volume(pt, size), predicate)
36  { }
Represent a 3D axis-aligned volume
Definition: Volume.cs:10

◆ WorldAreaTrigger() [4/4]

essentials.Systems.Triggers.WorldAreaTrigger.WorldAreaTrigger ( Vector3i  pt,
Func< IWorldReadonlyBlock, bool >  predicate = null 
)
39  :this(new Volume(pt, Size3i.One), predicate)
40  { }
Definition: Size3i.cs:6
Represent a 3D axis-aligned volume
Definition: Volume.cs:10
static readonly Size3i One
Definition: Size3i.cs:58

Member Function Documentation

◆ Dispose()

void essentials.Systems.Triggers.WorldAreaTrigger.Dispose ( )
73  {
74  if (!_disposed)
75  {
76  _world.OnBlockUpdate -= HandleBlockUpdate;
77  _triggered.Clear();
78  _disposed = true;
79  }
80  }
Action< IWorldBlock > OnBlockUpdate
Occurs when a block in the world has updated
Definition: IWorld.cs:43

Property Documentation

◆ TriggerCount

int essentials.Systems.Triggers.WorldAreaTrigger.TriggerCount
get

◆ Triggered

Action<ITrigger> essentials.Systems.Triggers.WorldAreaTrigger.Triggered
addremove

The documentation for this class was generated from the following file: