Conversation
|
А не убирали файлики из каталога .github? почему-то не запускается проверка |
Вроде исправил, посмотрите пожалуйста |
| import { Logger } from './logger'; | ||
|
|
||
| export class Character { | ||
| className = ''; |
|
|
||
| export class Character { | ||
| className = ''; | ||
| private isBurn = false; |
There was a problem hiding this comment.
а если завтра появится отравление, заморозка? в принципе любой флаг - это звоночек, что может быть стоит переделать
| return this.isBurn; | ||
| } | ||
|
|
||
| protected isStunned = false; |
| this.health = MathHelper.genrateRandomNumber(this.minHealth, this.maxHealth); | ||
| this.strength = MathHelper.genrateRandomNumber(this.minStrength, this.maxStrength); | ||
| this.dexterity = MathHelper.genrateRandomNumber(this.minDexterity, this.maxDexterity); | ||
| this.characterName = this.selectColorName(names[MathHelper.genrateRandomNumber(0, names.length - 1)]); | ||
| this.manaRegeneration = MathHelper.genrateRandomNumber(this.minManaRegeneration, this.maxManaRegeneration); | ||
| this.classSkillCost = MathHelper.genrateRandomNumber(this.minClassSkillCost, this.maxClassSkillCost); |
There was a problem hiding this comment.
вот это лучше бы передавать извне, иначе тесты будет сложно написать
| this.health -= damage; | ||
| } | ||
|
|
||
| private selectColorName(name: string): string { |
There was a problem hiding this comment.
на это тесты точно надо (может и есть уже)
| @@ -0,0 +1,89 @@ | |||
| export const names: string[] = [ | |||
There was a problem hiding this comment.
вокруг этого можно создать get метод - который бы возвращал элемент по индексу и элемент случайный
There was a problem hiding this comment.
иначе тесты не получится получить
| this.phoneNumber = number; | ||
| this.year = year; | ||
| this.name = name; | ||
| private aYear: number; |
There was a problem hiding this comment.
если это код примера и он не нужен - удаляйте
| @@ -0,0 +1,21 @@ | |||
| export class MathHelper { | |||
There was a problem hiding this comment.
любой helper - звоночек что он может быть куда то в другое место перенесен
| this.numPlayers = numPlayers; | ||
| } | ||
|
|
||
| generatePlayers() { |
There was a problem hiding this comment.
как на этот метод написать тесты?
| ARCHER = 'ARCHER', | ||
| } | ||
|
|
||
| export const fireDamage = 10; |
No description provided.