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

Added Codewars, TV and channels classes task and RPG Saga (feature complete) #24

Open
wants to merge 46 commits into
base: Chadov_Sergej_Vadimovich
Choose a base branch
from

Conversation

fagirton
Copy link

@fagirton fagirton commented Nov 8, 2023

No description provided.

@@ -0,0 +1 @@
node_modules
Copy link
Contributor

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', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

тестов очень мало

@@ -0,0 +1,97 @@
export class Channel {
static chCount = -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

это поле тогда надо делать приватным

@@ -0,0 +1,33 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

Сагу отдельно посмотрю

@@ -0,0 +1,97 @@
export class Channel {
Copy link
Contributor

Choose a reason for hiding this comment

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

1 файл - 1 класс

Comment on lines 15 to 17
static channels: Array<Channel>;
static noChannel = new Channel('No Channel');
static tvAsciiParts: Array<string> = [
Copy link
Contributor

Choose a reason for hiding this comment

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

не злоупотребляйте статическими полями - это почти глобальные переменные, которые могу привести к непредсказуемому поведению

static tvCount = 0;
static channels: Array<Channel>;
static noChannel = new Channel('No Channel');
static tvAsciiParts: Array<string> = [
Copy link
Contributor

Choose a reason for hiding this comment

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

в ts есть многострочная строка

Comment on lines 38 to 41
brand: string;
model: string;
serialNumber: string;
channel: Channel;
Copy link
Contributor

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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

если что-то было передано не так, то как минимум в 1 месте бросьте exception

this.channel = Television.noChannel;
}

public printedTV(): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

вот название не очень соответствует тому, что происходит внутри

fagirton and others added 26 commits December 9, 2023 20:47
…age, calculated through affinity system; lots of names added
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