Class SpawnCandidateStructure<TSource>
An hierarchical data structure to store spawn candidates.
Inherited Members
Namespace: Holoride.ElasticSDK
Assembly: Holoride.ElasticSDK.Library.Runtime.dll
Syntax
public class SpawnCandidateStructure<TSource> : SparseCellDataStructure<TSource, SpawnCandidate>
Type Parameters
Name | Description |
---|---|
TSource | The type used as a key to relate objects to their generation source. |
Constructors
SpawnCandidateStructure(PositionToCellKeyDelegate)
Instantiates a SpawnCandidateStructure.
Declaration
public SpawnCandidateStructure(SpawnCandidateStructure<TSource>.PositionToCellKeyDelegate positionToCellKeyFunction)
Parameters
Type | Name | Description |
---|---|---|
SpawnCandidateStructure<TSource>.PositionToCellKeyDelegate | positionToCellKeyFunction | The function to convert a position into a cell key. |
Methods
AddCandidatesBySource(TSource, IEnumerable<SpawnCandidate>)
Adds a list of candidates with reference to their source.
Declaration
public void AddCandidatesBySource(TSource source, IEnumerable<SpawnCandidate> spawnCandidates)
Parameters
Type | Name | Description |
---|---|---|
TSource | source | The source of the candidates. |
IEnumerable<SpawnCandidate> | spawnCandidates | The candidates to add. |
CandidatesInCell(Vector2Int)
Gets a enumerable of all candidates within a cell.
Declaration
[Obsolete("This method is obsolete and will be removed. Use GetDataInCell(Vector2Int cellKey) instead.")]
public IEnumerable<SpawnCandidate> CandidatesInCell(Vector2Int cellKey)
Parameters
Type | Name | Description |
---|---|---|
Vector2Int | cellKey | The key of the cell. |
Returns
Type | Description |
---|---|
IEnumerable<SpawnCandidate> | Returns a collection of spawn candidates for specified cell keys of all generation contexts. |
ForEachCandidateInCell(Vector2Int, Action<SpawnCandidate>)
Calls a function on all candidates within a cell.
Declaration
public void ForEachCandidateInCell(Vector2Int cellKey, Action<SpawnCandidate> function)
Parameters
Type | Name | Description |
---|---|---|
Vector2Int | cellKey | The key of the cell. |
Action<SpawnCandidate> | function | The function to call. |
RemoveCandidatesBySource(TSource)
Removes all candidates created by the given source.
Declaration
public void RemoveCandidatesBySource(TSource source)
Parameters
Type | Name | Description |
---|---|---|
TSource | source | The source of the candidates. |
RemoveCandidatesFromOtherSources(TSource)
Removes all candidates created by any source other than the given source.
Declaration
public void RemoveCandidatesFromOtherSources(TSource remainingSource)
Parameters
Type | Name | Description |
---|---|---|
TSource | remainingSource | The source of the candidates to remain. |