Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 1.41 KB

README.md

File metadata and controls

57 lines (42 loc) · 1.41 KB

Injector

license


A library for libgdx, an open-source game development application framework written in java.

Injector is a dependency injector what injects objects at runtime, uses reflection. It can create object with its dependencies.


Including in Project

To use this in your gradle project, add the version number and jitpack repository information to your root build.gradle file:

allprojects {
    ext {
    	...
        injectorVersion = '1.0.0'
    }
    repositories {
	...
	maven { url 'https://jitpack.io' }
    }
}

And in your core project add the dependency:

dependencies {
    implementation "com.github.Dgzt:injector:$injectorVersion"
}

Usage

Inject object:

YourComponent component = Injector.get(YourComponent.class);

Dispose injector in your main dispose method:

@Override
public void dispose () {
    ...
    Injector.dispose();
}

Example application uses the Metal UI Skin created by Raymond "Raeleus" Buckley under the CC BY license. Check out the others!