Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fluid] 101 small API extensions #461

Closed
12 of 37 tasks
DaanVanYperen opened this issue Sep 12, 2016 · 4 comments
Closed
12 of 37 tasks

[Fluid] 101 small API extensions #461

DaanVanYperen opened this issue Sep 12, 2016 · 4 comments

Comments

@DaanVanYperen
Copy link
Collaborator

DaanVanYperen commented Sep 12, 2016

Undeveloped extension ideas for #458

  • Versatile type exposure
    • Single value type automatic defaullt getter/setter
    • Built in smart type handling (Pos2, Pos3)
      • But let users disable!
    • Extendable type handling.
    • Better fluid interface for arrays (m(p1) m(p1,p2) m(p1,p2,p3), m(...p).)
    • Fluid interface for lists (add/remove)
    • Fluid interface for @EntityId annotated fields class Using { @EntityId int using; } .using(item)
  • Mirror/copy
    • Component value copy
    • Entity mirror
    • init entity from archetype
    • E("prefab/player.json").pos(5,5);
  • Misc
    • E.toggleAnchor();
    • E::remove/add by type.
    • json convenience
    • Annotation to expose properties as (part of) the default parameters without having to define a manual set method.
  • Resolving
    • Fetch tags. E.withTag("tag").pos(5,5)
    • Fetch sets E.withGroup("group")
  • Plugin
    • Hook in third party generators in maven/gradle plugin (IterativeModelStrategy/BuilderModelStrategy)
  • Advanced
    • Fluid Interface for different scopes (library and game).
    • Generate for multithread support.
    • Prevent loss of component method parameter names in fluid interface.
    • Support generics

Finished

  • Annotations
    • Explicitly Exclude components, methods from fluid interface.
    • Force contract for fluid interface methods.
  • Misc
    • tag, group convenience
    • Write tests that actually test the E interface methods.
    • E(id).deleteFromWorld()
    • Disable default generators. (FieldComponentBooleanAccessorStrategy)
    • Fluid entity systems.

Advanced API

Value copy
Shallow copy of values from source to target.

e = E(sourceId);
E(targetId).pos(e).angle(e);

Init from entity
Create all components from source into target, and copy all values. basically a clone for empty entities,
mixin for filled entities.

e = E(sourceId);
E(targetId).mirror(e);

Init from archetype

E(archetype).pos(e).angle(e);

User convenience methods?!

Basically some convenience to expose your own convenience methods.

E(id).myMethod(a).myMethod(b);

Json convenience
Can't really gauge utility since single entity is a bit of an awkward scope.

String entityJson = e.json();
e2.json(entityJson); 
String componentJson = e.posJson();
e2.posJson(e2);

Fluid Entity Systems

Just because I'm particularly lazy we could even consider entity system tailored to hide away all the E(id) stuff.

class MySystem extends FluidIteratingSystem<E> {

  public void process(E e)
  {
       e.pos(5,5).script(sequence(..));
  }

}

Would be doable to provide adapters for entity subscriptions as well.

@DaanVanYperen
Copy link
Collaborator Author

Work is done, just needs a merge. closing ticket.

@DaanVanYperen
Copy link
Collaborator Author

Oops wrong ticket D:

@DaanVanYperen DaanVanYperen reopened this Sep 22, 2016
@gjroelofs
Copy link
Contributor

Got me all excited for a second!

@DaanVanYperen
Copy link
Collaborator Author

Bulk spring cleaning. Ticket too big.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants