Esempio n. 1
0
 public Services(IViewService view, IInputService input, IHudTextService hud, IPhysicService physic)
 {
     View          = view;
     inputService  = input;
     hudService    = hud;
     PhysicService = physic;
 }
Esempio n. 2
0
    public void ReplacePhysicService(IPhysicService newPhysicService)
    {
        var index     = MetaComponentsLookup.PhysicService;
        var component = (PhysicServiceComponent)CreateComponent(index, typeof(PhysicServiceComponent));

        component.PhysicService = newPhysicService;
        ReplaceComponent(index, component);
    }
Esempio n. 3
0
    public MetaEntity SetPhysicService(IPhysicService newPhysicService)
    {
        if (hasPhysicService)
        {
            throw new Entitas.EntitasException("Could not set PhysicService!\n" + this + " already has an entity with PhysicServiceComponent!",
                                               "You should check if the context already has a physicServiceEntity before setting it or use context.ReplacePhysicService().");
        }
        var entity = CreateEntity();

        entity.AddPhysicService(newPhysicService);
        return(entity);
    }
Esempio n. 4
0
    public void ReplacePhysicService(IPhysicService newPhysicService)
    {
        var entity = physicServiceEntity;

        if (entity == null)
        {
            entity = SetPhysicService(newPhysicService);
        }
        else
        {
            entity.ReplacePhysicService(newPhysicService);
        }
    }
 public RegisterPhysicServiceSystem(Contexts contexts, IPhysicService physicService)
 {
     _metaContext   = contexts.meta;
     _physicService = physicService;
 }