@Override
public void viewToRaw(ArrayList<EventCode> list, List<Object> rawList, EventCode code) {
// create for every parameter a new event raw code
for (int i = 0, l = code.getParameters().size(); i < l; i++) {
RubyObject obj;
int nid = code.getId();
int indent = code.getIndent();
// first code?
if (i == 0) {
// get obj
obj = code.getObject();
} else {
obj = (RubyObject) RGSSProjectHelper.getInterpreter(code.getYecl().getProject()).runScriptlet(
"return RPG::EventCommand.new(" + id + ")");
indent = code.getIndent();
nid = id2;
}
// update indent
obj.setInstanceVariable("@indent", new RubyFixnum(code.getObject().getRuntime(), indent));
// update id
obj.setInstanceVariable("@code", new RubyFixnum(code.getObject().getRuntime(), nid));
// set parameter
RubyArray r = (RubyArray) code.getObject().getInstanceVariable("@parameters");
r.rb_clear();
r.add(code.getParameters().get(i));