Space Engineers
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
Sandbox.Engine.Utils.MyLocalityGrouping Class Reference

Use this class to prevent multiple instances close to each other at the same time. Call add instance to test whether instance can be added. More...

Public Types

enum  GroupingMode { GroupingMode.ContainsCenter, GroupingMode.Overlaps }
 

Public Member Functions

 MyLocalityGrouping (GroupingMode mode)
 
bool AddInstance (TimeSpan lifeTime, Vector3 position, float radius, bool removeOld=true)
 This is currently O(n), when it's not enough, bounding volume tree or KD-tree will be used. More...
 
void RemoveOld ()
 This is O(r) where r is number of removed elements More...
 
void Clear ()
 

Public Attributes

GroupingMode Mode
 

Detailed Description

Use this class to prevent multiple instances close to each other at the same time. Call add instance to test whether instance can be added.

Definition at line 14 of file MyLocalityGrouping.cs.

Member Enumeration Documentation

Enumerator
ContainsCenter 
Overlaps 

Definition at line 16 of file MyLocalityGrouping.cs.

Constructor & Destructor Documentation

Sandbox.Engine.Utils.MyLocalityGrouping.MyLocalityGrouping ( GroupingMode  mode)
inline

Definition at line 46 of file MyLocalityGrouping.cs.

Member Function Documentation

bool Sandbox.Engine.Utils.MyLocalityGrouping.AddInstance ( TimeSpan  lifeTime,
Vector3  position,
float  radius,
bool  removeOld = true 
)
inline

This is currently O(n), when it's not enough, bounding volume tree or KD-tree will be used.

Definition at line 54 of file MyLocalityGrouping.cs.

void Sandbox.Engine.Utils.MyLocalityGrouping.Clear ( )
inline

Definition at line 85 of file MyLocalityGrouping.cs.

void Sandbox.Engine.Utils.MyLocalityGrouping.RemoveOld ( )
inline

This is O(r) where r is number of removed elements

Definition at line 75 of file MyLocalityGrouping.cs.

Member Data Documentation

GroupingMode Sandbox.Engine.Utils.MyLocalityGrouping.Mode

Definition at line 37 of file MyLocalityGrouping.cs.


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