Add support for Context global objects

This commit is contained in:
2022-08-30 17:22:09 +02:00
parent 0ec1cb4659
commit 5f90d337cf
2 changed files with 143 additions and 0 deletions

View File

@@ -85,6 +85,46 @@ public interface Context extends Updatable, Renderable, Disposable {
<E extends Event> void removeEventListener(EventType<E> type, Consumer<E> listener);
void putGlobal(String key, Object value);
void putGlobal(String key, boolean value);
void putGlobal(String key, byte value);
void putGlobal(String key, short value);
void putGlobal(String key, int value);
void putGlobal(String key, long value);
void putGlobal(String key, float value);
void putGlobal(String key, double value);
void putGlobal(String key, char value);
Object getGlobal(String key);
<T> T getGlobal(String key, Class<T> type);
boolean getBooleanGlobal(String key);
byte getByteGlobal(String key);
short getShortGlobal(String key);
int getIntGlobal(String key);
long getLongGlobal(String key);
float getFloatGlobal(String key);
double getDoubleGlobal(String key);
char getCharGlobal(String key);
String getStringGlobal(String key);
void init(Screen screen, Input input, Camera camera);
void input(Input input);