Skip to content

player hp verification - #17

Open
BrunohSL wants to merge 4 commits into
hack-and-slash:masterfrom
BrunohSL:master
Open

player hp verification#17
BrunohSL wants to merge 4 commits into
hack-and-slash:masterfrom
BrunohSL:master

Conversation

@BrunohSL

Copy link
Copy Markdown

No description provided.

Comment thread src/App.js Outdated
name: 'teste4',
initiative: 2,
hp: 0,
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Mandar sem os dados de teste.

Comment thread src/App.js
const nextTurn = characters.length - 1 > turn ? turn + 1 : 0;
let nextTurn = characters.length - 1 > turn ? turn + 1 : 0;
while (characters[nextTurn].hp <= 0) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

linha em branco a mais aqui

Comment thread src/App.js Outdated
nextTurn += 1;

if (nextTurn >= characters.length - 1) {
nextTurn = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

E se todo mundo estiver morto? É uma possibilidade? @victormiguez

Comment thread src/components/CharacterForm.js Outdated
const CharacterForm = ({ handleSubmit }) => (
<Formik
initialValues={{ name: '', initiative: '' }}
initialValues={{ name: '', initiative: '', hp: '' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seta o valor inicial de iniciativa e hp aqui pra 0 pra fazer mais sentido. O campo só vai lidar com números.

Comment thread src/App.js Outdated
let nextTurn = characters.length - 1 > turn ? turn + 1 : 0;
while (characters[nextTurn].hp <= 0) {

nextTurn += 1;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Aqui pode ser só nextTurn++

Comment thread src/App.js
const nextTurn = characters.length - 1 > turn ? turn + 1 : 0;
this.setState({ turn: nextTurn });
let nextTurn = characters.length - 1 > turn ? turn + 1 : 0;
const teste = characters.filter((character) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Colocar um nome mais descritivo pra essa const.

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.

2 participants