Struct SpawnHandle
Opaque reference to a spawned entity instance.
Combines an entity reference with the spawn type for tracking.
Assembly: Serenity.GameSpawner.Domain.dll
Syntax
public readonly struct SpawnHandle : IEquatable<SpawnHandle>
Constructors
SpawnHandle(GameEntityId, SpawnType)
Creates a new SpawnHandle for the specified instance and type.
Declaration
public SpawnHandle(GameEntityId instanceId, SpawnType type)
Parameters
| Type |
Name |
Description |
| GameEntityId |
instanceId |
The unique instance identity.
|
| SpawnType |
type |
The spawn type.
|
Fields
InstanceId
The unique identity of the spawned instance.
Declaration
public readonly GameEntityId InstanceId
Field Value
Type
The logical type of the spawned entity.
Declaration
public readonly SpawnType Type
Field Value
Properties
IsValid
Checks if this handle has a valid instance identity.
Declaration
public bool IsValid { get; }
Property Value
Methods
Create(SpawnType)
Creates a new SpawnHandle with an auto-generated instance identity.
Declaration
public static SpawnHandle Create(SpawnType type)
Parameters
| Type |
Name |
Description |
| SpawnType |
type |
The spawn type.
|
Returns
| Type |
Description |
| SpawnHandle |
A new SpawnHandle with a unique instance identity.
|
Equals(SpawnHandle)
Declaration
public bool Equals(SpawnHandle other)
Parameters
Returns
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
ToString()
Declaration
public override string ToString()
Returns
Overrides
Operators
operator ==(SpawnHandle, SpawnHandle)
Declaration
public static bool operator ==(SpawnHandle left, SpawnHandle right)
Parameters
Returns
operator !=(SpawnHandle, SpawnHandle)
Declaration
public static bool operator !=(SpawnHandle left, SpawnHandle right)
Parameters
Returns
Implements