Back to project page BoardGameDirector.
The source code is released under:
GNU General Public License
If you think the Android project BoardGameDirector listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.dilph.bgd.engine; // w w w . j a v a 2 s . c om /** * Created with IntelliJ IDEA. * User: pseudo * Date: 8/3/13 * Time: 5:16 PM * To change this template use File | Settings | File Templates. */ /** * A condition which can be evaluated against a counter */ public class CounterCondition { enum Condition { EQUAL, LTE,GTE, LT, GT } Condition condition; String counterName; int value ; public CounterCondition(String counterName, Condition condition, int value) { this.condition = condition; this.counterName = counterName; this.value = value; } public boolean checkCondition() { int otherValue = CounterManager.getInstance().getCount(counterName); switch(condition) { case EQUAL: return otherValue == value; case LTE: return otherValue <= value; case GTE: return otherValue >= value; case LT: return otherValue < value; case GT: return otherValue > value; default: return false; } } }