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

Android Configure Player Types and Markers #12

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

damonkelley
Copy link
Owner

@damonkelley damonkelley commented Jul 28, 2016

This adds the ability for a player to choose the player type, and the marker of the player.

To do this, I reworked the Loop and created multiple new Turns which may or may not advance the loop.

screen shot 2016-07-28 at 3 11 06 pm

For now, a Computer vs. Computer is not allowed.

screen shot 2016-07-28 at 3 15 42 pm

This is used by the LoopBuilder when the loop is first built. Automated
players will have an implementation for this, so they will start the
game once the loop has been built.
This introduces the MultiPlayerHumanTurn which will not advance the game
loop like a SinglePlayerHumanTurn will.
This allows the UI to be refreshed upon each state transition.
This factory is responsible for wiring up the different Turns to the
Loop based on the the player type
The preset is sent in the intent from the form in the previous activity.
private static final String HUMAN_VS_COMPUTER = "human-vs-computer";
private static final String HUMAN_VS_HUMAN = "human-vs-human";

public static LoopBuilder presetFor(String preset) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preset is sort of a weird name as an argument here, and maybe even for the class in general - is there a more focused name you can think of that reflects the specific thing that you're pre-setting?

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

Successfully merging this pull request may close these issues.

3 participants