public interface Instruction {
public void execute(Entity target, ArrayList arguments, World world);
}
public class Entity {
private HashMap properties = new HashMap();
public void setProperty(String name,Object value) {...}
public Object getProperty(String name,Object value) {...}
public void addPropertyListener(PropertyListener listener);
}
public class Command {
private ArrayList instructions = new ArrayList();
public Command(String defOrXML) {
// parse definition into instruction objects here
}
public void execute(World world, String commandLine) {
// parse command line, determine target and
// argument strings
for (int i=0;i<instructions.size();i++) {
Instruction current = (Instruction) instructions.get(i);
}
}
}
and breath…
public class SetPropertyInstruction implements Instruction {
public void execute(Entity target, ArrayList arguments, World world) {
target.setProperty(arguments.get(0).toString(),arguments.get(0));
}
}
public class DisplayInstruction implements Instruction {
public void execute(Entity target, ArrayList arguments, World world) {
StringBuffer buffer = new StringBuffer();
for (int i=0;i<arguments.size();i++) {
buffer.append(arguments.get(i).toString());
}
world.display(buffer.toString());
}
}
So the main game adds itself as a property list to all the character entities create. The world has a specialized property called “location” which when it changes it moves the player.
The devs come along, define a command that using the defined instructions modifies the “location” property which cause the character to move (i.e. climb rope).
Finally, if you like, you can add more instructions and improve what the devs can do… you might add a comparison instruction that prevents the list of instructions continuing if it fails… then you could have
define buy $item {check $player.invent includes gold} {setProperty $item location $player}
Essentially you end up defining your own little programming langugae. It’d probably be simpler just to let them use java 
Kev
