@SuppressWarnings("unchecked") protected T editEntity(Entity entity) { this.entity = entity; this.edit = entity.edit(); return (T) this; }
@SuppressWarnings("unchecked") protected T editEntity(Entity entity) { this.entity = entity; this.edit = entity.edit(); return (T) this; }
/** Begin building new entity.*/ public EntityBuilder(World world) { this.world = world; edit = world.createEntity().edit(); }
/** Begin building new entity based on archetype.*/ public EntityBuilder(World world, Archetype archetype) { this.world = world; edit = world.createEntity(archetype).edit(); }
@Override public boolean act(float delta, Entity e) { e.edit().add(component); return true; }
@Override public void process(Entity e) { e.edit().add(component); }
/** Begin building new entity.*/ public EntityBuilder(World world) { this.world = world; edit = world.createEntity().edit(); }
@Override public boolean act(float delta, Entity e) { e.edit().remove(componentClass); return true; }
@Override public void process(Entity e) { e.edit().create(componentClass); }
/** Begin building new entity based on archetype.*/ public EntityBuilder(World world, Archetype archetype) { this.world = world; edit = world.createEntity(archetype).edit(); }
@Override public void process(Entity e) { e.edit().remove(componentClass); }
@Override public void process(Entity e) { e.edit().add(component); }
@Override public void process(Entity e) { e.edit().create(componentClass); }
/** * Add operation to entity. * @param e Apply script to passed entity. * @see net.mostlyoriginal.api.operation.flow.ParallelOperation * @see net.mostlyoriginal.api.operation.flow.SequenceOperation */ public void on(Entity e) { e.edit().create(Schedule.class).add(this); }
/** * Add operation to entity. * @param e Apply script to passed entity. * @see net.mostlyoriginal.api.operation.flow.ParallelOperation * @see net.mostlyoriginal.api.operation.flow.SequenceOperation */ public void on(Entity e) { e.edit().create(Schedule.class).add(this); }
/** * Add operation to empty entity in world. * @param world */ public void on(World world) { world.createEntity().edit().create(Schedule.class).add(this); }
/** * Add operation to empty entity in world. * @param world */ public void on(World world) { world.createEntity().edit().create(Schedule.class).add(this); }
private void readComponentsEdit(Json json, Entity e, JsonValue component) { SaveFileFormat.ComponentIdentifiers identifiers = serializationState.componentIdentifiers; EntityEdit edit = e.edit(); while (component != null) { assert (component.name() != null); Class<? extends Component> componentType = identifiers.getType(component.name); readComponent(json, component, edit.create(componentType)); component = component.next; } }
private void readComponentsEdit(Json json, Entity e, JsonValue component) { SaveFileFormat.ComponentIdentifiers identifiers = serializationState.componentIdentifiers; EntityEdit edit = e.edit(); while (component != null) { assert (component.name() != null); Class<? extends Component> componentType = identifiers.getType(component.name); readComponent(json, component, edit.create(componentType)); component = component.next; } }
private void readComponentsEdit(Json json, Entity e, JsonValue component) { SaveFileFormat.ComponentIdentifiers identifiers = serializationState.componentIdentifiers; EntityEdit edit = e.edit(); while (component != null) { assert (component.name() != null); Class<? extends Component> componentType = identifiers.getType(component.name); readComponent(json, component, edit.create(componentType)); component = component.next; } }