Example #1
0
 public Entity Create(EntityData data)
 {
     if (_blueprints.ContainsKey(data.Type))
     {
         var entity = _blueprints[data.Type](data);
         entity.Name = data.Name;
         entity.Position = data.Position;
         return entity;
     }
     throw new InvalidOperationException("Unknown entity");
 }
Example #2
0
 public Bottle CreateBottle(EntityData data)
 {
     var entity = _kernel.Get<Bottle>();
     entity.Message = data.Properties["Message"]; // yolo
     return entity;
 }