All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.artemis.link.IntFieldMutator Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
package com.artemis.link;

import com.artemis.Component;
import com.artemis.World;
import com.artemis.utils.reflect.Field;
import com.artemis.utils.reflect.ReflectionException;

class IntFieldMutator implements UniFieldMutator {
	@Override
	public int read(Component c, Field f) {
		try {
			return (Integer) f.get(c);
		} catch (ReflectionException e) {
			throw new RuntimeException(e);
		}
	}

	@Override
	public void write(int value, Component c, Field f) {
		try {
			f.set(c, value);
		} catch (ReflectionException e) {
			throw new RuntimeException(e);
		}
	}

	@Override
	public void setWorld(World world) {}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy