From 260cc55c485980cd31193300962a88f1de8d62f7 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 28 Mar 2016 08:47:45 -0400 Subject: Moved dice things to seperate project --- .../java/bjc/utils/dice/BindingDiceExpression.java | 77 ---------------------- 1 file changed, 77 deletions(-) delete mode 100644 BJC-Utils2/src/main/java/bjc/utils/dice/BindingDiceExpression.java (limited to 'BJC-Utils2/src/main/java/bjc/utils/dice/BindingDiceExpression.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/dice/BindingDiceExpression.java b/BJC-Utils2/src/main/java/bjc/utils/dice/BindingDiceExpression.java deleted file mode 100644 index 9ecce97..0000000 --- a/BJC-Utils2/src/main/java/bjc/utils/dice/BindingDiceExpression.java +++ /dev/null @@ -1,77 +0,0 @@ -package bjc.utils.dice; - -import java.util.Map; - -/** - * A variable expression that represents binding a variable to a name in an - * enviroment - * - * @author ben - * - */ -public class BindingDiceExpression implements IDiceExpression { - /** - * The expression being bound to a name - */ - private IDiceExpression exp; - - /** - * The name to bind the expression to - */ - private String name; - - /** - * Create a new dice expression binder from two expressions and an - * enviroment - * - * @param left - * The left side expression to get a name from. Must be a - * ReferenceDiceExpression - * @param right - * The right side to bind to the name - * @param env - * The enviroment to bind into - */ - public BindingDiceExpression(IDiceExpression left, - IDiceExpression right, Map env) { - this(((ReferenceDiceExpression) left).getName(), right, env); - } - - /** - * Create a new dice expression binder - * - * @param name - * The name of the variable to bind - * @param exp - * The expression to bind to the variable - * @param env - * The enviroment to bind it in - */ - public BindingDiceExpression(String name, IDiceExpression exp, - Map env) { - this.name = name; - this.exp = exp; - - env.put(name, exp); - } - - /* - * (non-Javadoc) - * - * @see bjc.utils.dice.IDiceExpression#roll() - */ - @Override - public int roll() { - return exp.roll(); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "assign[n=" + name + ", exp=" + exp.toString() + "]"; - } -} -- cgit v1.2.3