MCPcopy Create free account
hub / github.com/PCGen/pcgen / run

Method run

code/src/java/plugin/jepcommands/RollCommand.java:55–78  ·  view source on GitHub ↗

Runs getvar on the inStack. The parameter is popped off the inStack, and the variable's value is pushed back to the top of inStack. @param inStack the jep stack @throws ParseException

(final Stack inStack)

Source from the content-addressed store, hash-verified

53 * @throws ParseException
54 */
55 @SuppressWarnings("unchecked") //Uses JEP, which doesn't use generics
56 @Override
57 public void run(final Stack inStack) throws ParseException
58 {
59 // check the stack
60 checkStack(inStack);
61
62 // get the parameter from the stack
63
64 //
65 // have to do this in reverse order...this is a stack afterall
66 //
67 final Object param1 = inStack.pop();
68
69 if (param1 instanceof String)
70 {
71 final Object result = pcgen.core.RollingMethods.roll((String) param1);
72 inStack.push(result);
73 }
74 else
75 {
76 throw new ParseException("Invalid parameter type");
77 }
78 }
79}

Callers

nothing calls this directly

Calls 3

popMethod · 0.80
pushMethod · 0.80
rollMethod · 0.65

Tested by

no test coverage detected