for (Iterator<?> parameterIterator = eventElement.elementIterator("parameter"); parameterIterator.hasNext();)
{
Element parameterElement = (Element) parameterIterator.next();
set.set(parameterElement.attributeValue("name"), parameterElement.attributeValue("value"));
}
GlobalEvent event = constructor.newInstance(set);
event.addOnStartActions(parseActions(eventElement.element("on_start"), Integer.MAX_VALUE));
event.addOnStopActions(parseActions(eventElement.element("on_stop"), Integer.MAX_VALUE));
event.addOnInitActions(parseActions(eventElement.element("on_init"), Integer.MAX_VALUE));
Element onTime = eventElement.element("on_time");
if (onTime != null)
{
for (Iterator<?> onTimeIterator = onTime.elementIterator("on"); onTimeIterator.hasNext();)
{
Element on = (Element) onTimeIterator.next();
int time = Integer.parseInt(on.attributeValue("time"));
List<EventAction> actions = parseActions(on, time);
event.addOnTimeActions(time, actions);
}
}
for (Iterator<?> objectIterator = eventElement.elementIterator("objects"); objectIterator.hasNext();)
{
Element objectElement = (Element) objectIterator.next();
String objectsName = objectElement.attributeValue("name");
List<Serializable> objects = parseObjects(objectElement);
event.addObjects(objectsName, objects);
}
getHolder().addEvent(type, event);
}
}