Rogue: Savage Rats, a retro-themed dungeon crawler
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
rogue-savage-rats/src/mightypork/gamecore/util/math/constraints/ConstraintCache.java

44 lines
733 B

package mightypork.gamecore.util.math.constraints;
/**
* Constraint cache
*
* @author Ondřej Hruška (MightyPork)
* @param <C> constraint type
*/
public interface ConstraintCache<C> extends Pollable {
/**
* Called after the cache has changed value (and digest).
*/
void onConstraintChanged();
/**
* @return the cached value
*/
C getCacheSource();
/**
* Enable caching & digest caching
*
* @param yes enable caching
*/
void enableCaching(boolean yes);
/**
* @return true if caching is on
*/
boolean isCachingEnabled();
/**
* Update cached value and cached digest (if digest caching is enabled).<br>
* source constraint is polled beforehand.
*/
@Override
void poll();
}