Class AbstractEntityMapper
Provides a base implementation for the IGeneratedEntityLogger interface for all agent entities
which can be serialize/deserialized.
Inherited Members
Namespace: Mars.Core.Data.Compiler
Assembly: Mars.Core.dll
Syntax
public abstract class AbstractEntityMapper : AbstractMapper<IEntity>, IGeneratedEntityLogger, IGeneratedLogger<IEntity>, IOutputLogger
Remarks
The concrete implementations are generated at runtime by the Mars.Core.Data.Compiler.ProxyEntityGenerator
Properties
Position
Declaration
public Position Position { get; }
Property Value
Type | Description |
---|---|
Position |
Methods
Initialize()
Performs a deferred initialization of this entity-specific mapper.
This makes it possible to assign properties with values before
(e.g., the concrete entity ).
Declaration
public override void Initialize()
Overrides
Mars.Core.Data.Compiler.AbstractMapper<IEntity>.Initialize()
Remarks
This method should always be used when something have to be implemented within the constructor scope.
IsPositionSerializable(BoundingBox)
Checks for the current instance, based on their position whether this instance is within the bounding box or not.
Declaration
public bool IsPositionSerializable(BoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | box | The bounding box with lower left and upper right corner specification to check whether the position is in that box. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true when the instance can be serialized otherwise false |
SerializeToDocument()
Serialize this instance of the proxy with the corresponding output
properties described in into a MongoDb
conforming which is reused for each tick.
Declaration
public override BsonDocument SerializeToDocument()
Returns
Type | Description |
---|---|
BsonDocument |
Overrides
Mars.Core.Data.Compiler.AbstractMapper<IEntity>.SerializeToDocument()