-
Notifications
You must be signed in to change notification settings - Fork 34
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
Added Codewars, TV and channels classes task and RPG Saga (feature complete) #24
base: Chadov_Sergej_Vadimovich
Are you sure you want to change the base?
Conversation
@@ -0,0 +1 @@ | |||
node_modules |
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.
по идее gitignore выше должен ловить все node_modules
new Channel('Cartoon Network'), | ||
]; | ||
|
||
describe('Testing printing TV ASCII', () => { |
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.
тестов очень мало
rpgsaga/saga/src/tv.ts
Outdated
@@ -0,0 +1,97 @@ | |||
export class Channel { | |||
static chCount = -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.
это поле тогда надо делать приватным
@@ -0,0 +1,33 @@ | |||
|
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.
Сагу отдельно посмотрю
rpgsaga/saga/src/tv.ts
Outdated
@@ -0,0 +1,97 @@ | |||
export class Channel { |
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.
1 файл - 1 класс
rpgsaga/saga/src/tv.ts
Outdated
static channels: Array<Channel>; | ||
static noChannel = new Channel('No Channel'); | ||
static tvAsciiParts: Array<string> = [ |
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.
не злоупотребляйте статическими полями - это почти глобальные переменные, которые могу привести к непредсказуемому поведению
rpgsaga/saga/src/tv.ts
Outdated
static tvCount = 0; | ||
static channels: Array<Channel>; | ||
static noChannel = new Channel('No Channel'); | ||
static tvAsciiParts: Array<string> = [ |
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.
в ts есть многострочная строка
rpgsaga/saga/src/tv.ts
Outdated
brand: string; | ||
model: string; | ||
serialNumber: string; | ||
channel: Channel; |
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.
поля делайте приватными
|
||
public printedTV(): string { | ||
let channelAscii = ''; | ||
if (this.channel.name.length <= 18) { |
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.
если что-то было передано не так, то как минимум в 1 месте бросьте exception
rpgsaga/saga/src/tv.ts
Outdated
this.channel = Television.noChannel; | ||
} | ||
|
||
public printedTV(): string { |
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.
вот название не очень соответствует тому, что происходит внутри
This reverts commit bac7c0d.
…age, calculated through affinity system; lots of names added
No description provided.