/** Initialize the Ecore element when inside a script. */ public void eInit(SarlScript script, String name, IJvmTypeProvider context) { setTypeResolutionContext(context); if (this.sarlAgent == null) { this.sarlAgent = SarlFactory.eINSTANCE.createSarlAgent(); script.getXtendTypes().add(this.sarlAgent); this.sarlAgent.setAnnotationInfo(XtendFactory.eINSTANCE.createXtendTypeDeclaration()); if (!Strings.isEmpty(name)) { this.sarlAgent.setName(name); } } }