Beispiel #1
0
    public void ReplaceGameServiceEntitasInputService(Game.Service.IInputService newEntitasInputService)
    {
        var index     = ServiceComponentsLookup.GameServiceEntitasInputService;
        var component = (Game.Service.EntitasInputServiceComponent)CreateComponent(index, typeof(Game.Service.EntitasInputServiceComponent));

        component.EntitasInputService = newEntitasInputService;
        ReplaceComponent(index, component);
    }
Beispiel #2
0
    public ServiceEntity SetGameServiceEntitasInputService(Game.Service.IInputService newEntitasInputService)
    {
        if (hasGameServiceEntitasInputService)
        {
            throw new Entitas.EntitasException("Could not set GameServiceEntitasInputService!\n" + this + " already has an entity with Game.Service.EntitasInputServiceComponent!",
                                               "You should check if the context already has a gameServiceEntitasInputServiceEntity before setting it or use context.ReplaceGameServiceEntitasInputService().");
        }
        var entity = CreateEntity();

        entity.AddGameServiceEntitasInputService(newEntitasInputService);
        return(entity);
    }
Beispiel #3
0
    public void ReplaceGameServiceEntitasInputService(Game.Service.IInputService newEntitasInputService)
    {
        var entity = gameServiceEntitasInputServiceEntity;

        if (entity == null)
        {
            entity = SetGameServiceEntitasInputService(newEntitasInputService);
        }
        else
        {
            entity.ReplaceGameServiceEntitasInputService(newEntitasInputService);
        }
    }