Feature request: Custom arguments in Pool's builder func
First, thank you for really convinent api and many usefull features!
Context
I'm making simple galaxy shooter game with exalibur, where enemies have different textures, based on a parameter in constructor (just a Enum). And I wanna use pool for enemies, so I need to be able change texture type of enemy when getting it from pool.
Proposal
This is possible now like these:
pool.get().setType(EnemyType.Rocket)
but it will more convenient if I could do somethhing like these:
pool.get(EnemyType.Rocket)
I totally support this feature! It should be possible to extract the argument list type from the builder function. To avoid breaking existing stuff, would it be okay to add a new .getWithParameters(...builderParams)?
I'm making simple galaxy shooter game with exalibur, where enemies have different textures, based on a parameter in constructor (just a Enum). And I wanna use pool for enemies, so I need to be able change texture type of enemy when getting it from pool.
Also for your specific game, RentalPool might be better since that one assumes objects live for a long time, Pool assumes objects are short lived and reclaimed all at once when .done() is called.
Yes, but I think that .getWithParameters name is too long for convenient use, maybe .getWithParams(...builderParams) or even .getWith(...builderParams)? However, naming is up to you.
And thanks for good advice about RentalPool!
Oh I like .getWith(...)!