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 --- .../bjc/utils/dice/ReferenceDiceExpression.java | 70 ---------------------- 1 file changed, 70 deletions(-) delete mode 100644 BJC-Utils2/src/main/java/bjc/utils/dice/ReferenceDiceExpression.java (limited to 'BJC-Utils2/src/main/java/bjc/utils/dice/ReferenceDiceExpression.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/dice/ReferenceDiceExpression.java b/BJC-Utils2/src/main/java/bjc/utils/dice/ReferenceDiceExpression.java deleted file mode 100644 index d38e0f9..0000000 --- a/BJC-Utils2/src/main/java/bjc/utils/dice/ReferenceDiceExpression.java +++ /dev/null @@ -1,70 +0,0 @@ -package bjc.utils.dice; - -import java.util.Map; - -/** - * A dice expression that refers to a variable bound in a mutable - * enviroment - * - * @author ben - * - */ -public class ReferenceDiceExpression implements IDiceExpression { - /** - * The enviroment to do variable dereferencing against - */ - private Map env; - - /** - * The name of the bound variable - */ - private String name; - - /** - * Create a new reference dice expression referring to the given name - * in an enviroment - * - * @param name - * The name of the bound variable - * @param env - * The enviroment to resolve the variable against - */ - public ReferenceDiceExpression(String name, - Map env) { - this.name = name; - this.env = env; - } - - /** - * Get the name of the referenced variable - * - * @return the name of the referenced variable - */ - public String getName() { - return name; - } - - /* - * (non-Javadoc) - * - * @see bjc.utils.dice.IDiceExpression#roll() - */ - @Override - public int roll() { - return env.get(name).roll(); - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - if (env.containsKey(name)) { - return env.get(name).toString(); - } else { - return name; - } - } -} -- cgit v1.2.3