Hi, I am investigating the capabilities of Guice for inclusion in future projects, and playing around I've hit a small snag that I can't seem to find a simple answer to. Let's say I have a Checker's game application with a ctor like:
public CheckersGame(Player redPlayer, Player blackPlayer) ...and my Player class has a ctor like: public Player(Boolean isRed) ...I've created a Module with bindings in the configure() method like: bind(CheckersGame.class).to(BasicCheckersGame.class); bind(Player.class).to(HumanPlayer.class); ...This will create and pass two HumanPlayers into the BasicCheckersGame constructor. How do I create bindings so that the redPlayer instance is created and passed to the Game ctor with a 'true' value, and blackPlayer with 'false'? I've seen a few examples around that seem like they might answer this, but they all seem quite convoluted and I'm thinking there must be a simple way to achieve this in the framework. Thanks for any info. -- You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
