Game.PrisonerTransportRequest
Assembly: Game (assembly not explicitly specified in source)
Namespace: Game.Simulation
Type: struct (value type)
Base: IComponentData, IQueryTypeParameter, ISerializable
Summary:
Represents a request to transport a prisoner (or a transport target) inside the ECS world. This struct is a lightweight component intended for use with Unity's DOTS/ECS; it stores a reference to an Entity that is the transport target and an integer priority used to order or prioritize transport requests. It implements serialization interfaces so it can be written/read by the game's custom serialization system.
Fields
-
public Entity m_Target
The Entity that is the target of the transport request (typically the prisoner entity or the entity representing the object to be transported). Serialized first in Serialize/Deserialize. -
public int m_Priority
An integer priority value for this request. Higher (or lower—depending on game logic) values should be used to sort or select which transport requests are handled first. Serialized second in Serialize/Deserialize.
Properties
- None. This type exposes fields directly and does not define any properties.
Constructors
public PrisonerTransportRequest(Entity target, int priority)
Creates a new PrisonerTransportRequest initialized with the provided target entity and priority.
Methods
-
public void Serialize<TWriter>(TWriter writer) where TWriter : IWriter
Writes this component's data to the provided writer. The method writes m_Target first, then m_Priority. Use this for saving or network transfer via the game's IWriter implementation. -
public void Deserialize<TReader>(TReader reader) where TReader : IReader
Reads this component's data from the provided reader. The method reads m_Target first, then m_Priority, assigning into the struct's fields (uses ref assignment). The reader must provide compatible ordering and types.
Usage Example
// Create a request and add it as a component to an entity using EntityManager
var request = new PrisonerTransportRequest(prisonerEntity, priorityValue);
entityManager.AddComponentData(requestEntity, request);
// Example illustrating serialization (using a hypothetical writer/reader):
request.Serialize(writer);
// later...
var loadedRequest = new PrisonerTransportRequest();
loadedRequest.Deserialize(reader);