public void CreateActorWithoutParameters() { var actor = _actorFactory.Create(); actor.Id.Should().BeGreaterOrEqualTo(0); actor.Components.Should().NotBeNull(); }
protected override TActor CreateEntity(Type?actorType, int id, IComponent[]?components) { var actor = actorType == null ? _actorFactory.Create(components, id) : _actorFactory.Create(actorType, components, id); return((TActor)actor); }
public Actor Create(IComponent[]?components = null) { var actor = _actorFactory.Create(components); Actors.Add(actor); return(actor); }
public void RegisterNewActor(string name, string tag, string assetTag) { var instance = actorFactory.Create(assetTag); instance.Transform.SetParent(actorView, false); instance.Enabled = false; actors[name] = instance; }
public static PID Spawn <T>(this IContext context, IActorFactory factory) where T : IActor => context.Spawn(Props.FromProducer(() => factory.Create <T>()));
public static PID SpawnPrefix <T>(this IContext context, IActorFactory factory) where T : IActor => context.SpawnPrefix(Props.FromProducer(() => factory.Create <T>()), typeof(T).Name);
public readonly Actor Build() { return(_actorFactory.Create(_components.ToArray(), _id)); }