-
Notifications
You must be signed in to change notification settings - Fork 4
player hp verification #17
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
base: master
Are you sure you want to change the base?
Conversation
src/App.js
Outdated
name: 'teste4', | ||
initiative: 2, | ||
hp: 0, | ||
}, |
There was a problem hiding this comment.
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.
const nextTurn = characters.length - 1 > turn ? turn + 1 : 0; | ||
let nextTurn = characters.length - 1 > turn ? turn + 1 : 0; | ||
while (characters[nextTurn].hp <= 0) { | ||
|
There was a problem hiding this comment.
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
src/App.js
Outdated
nextTurn += 1; | ||
|
||
if (nextTurn >= characters.length - 1) { | ||
nextTurn = 0; |
There was a problem hiding this comment.
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
src/components/CharacterForm.js
Outdated
const CharacterForm = ({ handleSubmit }) => ( | ||
<Formik | ||
initialValues={{ name: '', initiative: '' }} | ||
initialValues={{ name: '', initiative: '', hp: '' }} |
There was a problem hiding this comment.
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.
src/App.js
Outdated
let nextTurn = characters.length - 1 > turn ? turn + 1 : 0; | ||
while (characters[nextTurn].hp <= 0) { | ||
|
||
nextTurn += 1; |
There was a problem hiding this comment.
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++
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) => { |
There was a problem hiding this comment.
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.
No description provided.