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

Feature/complete workflow #19

Merged
merged 6 commits into from
Apr 10, 2017
Merged

Feature/complete workflow #19

merged 6 commits into from
Apr 10, 2017

Conversation

wovalle
Copy link
Member

@wovalle wovalle commented Apr 5, 2017

No description provided.

Copy link
Member

@wistcc wistcc left a comment

Choose a reason for hiding this comment

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

LVGTM. Just a few comments.

return {
key: c.key,
visible: werewolfService.isInDeck(c.key, currentDeck),
value: 1,
Copy link
Member

Choose a reason for hiding this comment

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

I think that this is not correct, isn't it?

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you mean?

Copy link
Member

Choose a reason for hiding this comment

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

This 1 hardcoded?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, that's required to be hardcoded (for now). That's the initial amount that a card will have. In order to remove this hardcode number we should have a centralized storage of cards amount (yes, this actually exists in the werewolf brain but the api doesn't return cards amounts).

<label><input type="checkbox" name={c.role} /> {c.role}</label>
</div>
<div class="col-md-6 col-xs-12" key={c.key}>
<label><input type="checkbox" onChange={this.setVisibility} checked={c.visible || false} name={c.key} /> {c.key}</label>
Copy link
Member

Choose a reason for hiding this comment

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

c.visible || false is not enough c.visible?

import werewolfService from '../services/werewolf';

const DEFAULT_GAME_MODE = 'balanced';
Copy link
Member

Choose a reason for hiding this comment

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

Probably we should create another file with this 'balanced', 'chaosand'basic'`.

Copy link
Member Author

Choose a reason for hiding this comment

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

<button onClick={browserHistory.goBack} className="btn btn-default pull-left col-md-2 col-xs-12 btn-space"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back</button>
<button onClick={browserHistory.goBack} className="btn btn-default col-md-2 col-xs-12 btn-space"><i class="fa fa-arrow-left" aria-hidden="true"></i></button>
<button onClick={this.props.startGame.bind(this, "chaos")} className="btn btn-default col-md-4 col-md-offset-1 col-xs-12 btn-space"><i class="fa fa-arrows" aria-hidden="true"></i> Quick Chaos</button>
<button onClick={this.props.startGame.bind(this, "balanced")} className="btn btn-default col-md-4 col-md-offset-1 col-xs-12 btn-space"><i class="fa fa-balance-scale" aria-hidden="true"></i> Quick Balanced</button>
Copy link
Member

Choose a reason for hiding this comment

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

Probably we should create another file with this 'balanced', 'chaosand'basic'`.

Copy link
Member Author

Choose a reason for hiding this comment

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

<Link to={{pathname:"game", query:{type: "chaos"} }} className="btn btn-default col-md-4 pull-left"><i class="fa fa-arrows" aria-hidden="true"></i> Quick Chaos</Link>
<Link to={{pathname:"game", query:{type: "balanced"} }} className="btn btn-default col-md-4 pull-right"><i class="fa fa-balance-scale" aria-hidden="true"></i> Quick Balanced</Link>
<button onClick={this.props.startGame.bind(this, "chaos")} className="btn btn-default col-md-5"><i class="fa fa-arrows" aria-hidden="true"></i> Quick Chaos</button>
<button onClick={this.props.startGame.bind(this, "balanced")} className="btn btn-default col-md-5 col-md-offset-2"><i class="fa fa-balance-scale" aria-hidden="true"></i> Quick Balanced</button>
Copy link
Member

Choose a reason for hiding this comment

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

Probably we should create another file with this 'balanced', 'chaosand'basic'`.

Copy link
Member Author

Choose a reason for hiding this comment

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

<Link to={{pathname:"game", query:{type: "chaos"} }} className="btn btn-danger pull-right col-md-4 col-xs-12 btn-space"><i class="fa fa-arrows" aria-hidden="true"></i> Start Chaos </Link>
<button onClick={browserHistory.goBack} className="btn btn-default pull-left col-md-2 col-xs-12 btn-space"><i class="fa fa-arrow-left" aria-hidden="true"></i> Back</button>
<button onClick={browserHistory.goBack} className="btn btn-default col-md-2 col-xs-12 btn-space"><i class="fa fa-arrow-left" aria-hidden="true"></i></button>
<button onClick={this.props.startGame.bind(this, "chaos")} className="btn btn-default col-md-4 col-md-offset-1 col-xs-12 btn-space"><i class="fa fa-arrows" aria-hidden="true"></i> Quick Chaos</button>
Copy link
Member

Choose a reason for hiding this comment

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

Probably we should create another file with this 'balanced', 'chaosand'basic'`.

Copy link
Member Author

Choose a reason for hiding this comment

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

</div>
<hr />
<div class="col-md-12">
<Link to={{pathname:"game", query:{type: "chaos"} }} className="btn btn-default col-md-4 pull-left"><i class="fa fa-arrows" aria-hidden="true"></i> Quick Chaos</Link>
<Link to={{pathname:"game", query:{type: "balanced"} }} className="btn btn-default col-md-4 pull-right"><i class="fa fa-balance-scale" aria-hidden="true"></i> Quick Balanced</Link>
<button onClick={this.props.startGame.bind(this, "chaos")} className="btn btn-default col-md-5"><i class="fa fa-arrows" aria-hidden="true"></i> Quick Chaos</button>
Copy link
Member

Choose a reason for hiding this comment

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

Probably we should create another file with this 'balanced', 'chaosand'basic'`.

Copy link
Member Author

Choose a reason for hiding this comment

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

}

getCards() {
return brain.getAllCards();
const cards = brain.getCards();
return Object.keys(cards).map(_ => {return {key: _, value: cards[_]}});
Copy link
Member

Choose a reason for hiding this comment

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

I'm a full fan of always having very descriptive names!

@wovalle
Copy link
Member Author

wovalle commented Apr 8, 2017

@wistcc Since the original motive of this pr was to implement the full workflow of the project, I created two issues with enhancements ( #22 and #23 ) to take care of the standardization of gameTypes and languages.

@wovalle wovalle mentioned this pull request Apr 8, 2017
@wovalle wovalle merged commit 6b8200c into develop Apr 10, 2017
@wovalle wovalle deleted the feature/complete-workflow branch April 10, 2017 22:43
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