public void CreateEntity(long entityId, EntityTemplate template)
        {
            var handler = new EntityTemplateDynamicHandler(template, entityId, currentDiff);

            Dynamic.ForEachComponent(handler);
        }
 public RemoveEntityTemplateDynamicHandler(EntityTemplate template, long entityId, ViewDiff viewDiff)
 {
     this.template = template;
     this.entityId = entityId;
     this.viewDiff = viewDiff;
 }
示例#3
0
 /// <summary>
 ///     Adds an entity to the snapshot
 /// </summary>
 /// <remarks>
 ///    The entity ID is automatically assigned.
 /// </remarks>
 /// <param name="entityTemplate">The entity to be added to the snapshot.</param>
 public void AddEntity(EntityTemplate entityTemplate)
 {
     entities[new EntityId(entities.Count + 1)] = entityTemplate.GetEntity();
 }
示例#4
0
 /// <summary>
 ///     Adds an entity to the snapshot
 /// </summary>
 /// <param name="entityId">The entity ID of the entity to be added to the snapshot</param>
 /// <param name="entityTemplate">The entity to be added to the snapshot.</param>
 /// <remarks>
 ///    You should obtain `entityId` using the `GetNextEntityId()` method, otherwise you could be given
 ///    invalid entity IDs.
 /// </remarks>
 public void AddEntity(EntityId entityId, EntityTemplate entityTemplate)
 {
     entities[entityId] = entityTemplate.GetEntity();
 }