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

de.rpgframework.genericrpg.MappedNumericalValue Maven / Gradle / Ivy

The newest version!
package de.rpgframework.genericrpg;

import java.util.function.Function;
import java.util.function.Supplier;

/**
 *
 */
public class MappedNumericalValue implements NumericalValue {

	private T value;
	private Supplier callback;

	//-------------------------------------------------------------------
	public MappedNumericalValue(T value, Supplier callback) {
		this.value = value;
		this.callback = callback;
	}

	//-------------------------------------------------------------------
	/**
	 * @see de.rpgframework.genericrpg.SelectedValue#getModifyable()
	 */
	@Override
	public T getModifyable() {
		return value;
	}

	//-------------------------------------------------------------------
	/**
	 * @see de.rpgframework.genericrpg.NumericalValue#getDistributed()
	 */
	@Override
	public int getDistributed() {
		return callback.get();
	}

	//-------------------------------------------------------------------
	/**
	 * @see de.rpgframework.genericrpg.NumericalValue#setDistributed(int)
	 */
	@Override
	public void setDistributed(int points) {
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy