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

RPG Saga by Kirill Bokov #26

Closed
wants to merge 15 commits into from
Closed

RPG Saga by Kirill Bokov #26

wants to merge 15 commits into from

Conversation

Kirill-Bokov
Copy link

Просто хочу показать, что работа идёт

Comment on lines 4 to 7
constructor(deviceName: string, device_energy_consumption : number) {
this._name = deviceName;
this.energy_consumption = device_energy_consumption;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

получается можно поставить отрицательные значения на потребление энергии

print_name(): void {
console.log(`Имя: ${this._name}`);
}
public get name(){
Copy link
Contributor

Choose a reason for hiding this comment

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

не указан тип возвращаемого значения

public get name(){
return this._name
}
public set name(input : string){
Copy link
Contributor

Choose a reason for hiding this comment

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

лучше указать void в качестве типа возвращаемого значения

Comment on lines 23 to 24
this._memory = memory;
this.data_transfer_time_sec = data_transfer_time_sec;
Copy link
Contributor

Choose a reason for hiding this comment

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

тут тоже могу сделать отрицательными

data_transfer_time_sec : number;
constructor(deviceName : string, memory : number, data_transfer_time_sec : number, device_energy_consumption : number) {
super(deviceName, device_energy_consumption);
this._memory = memory;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
this._memory = memory;
this.memory = memory;

Это приведет к вызову сеттера с соответствующей проверкой

this._memory = input;
} else {
this._memory = 0;
console.log("Ошибка при вводе памяти!")
Copy link
Contributor

Choose a reason for hiding this comment

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

бросайте тут эксепшен

Comment on lines 41 to 42
let pc = new HDD("Toshiba", 1024, 512, 400);
console.log(pc.memory)
Copy link
Contributor

Choose a reason for hiding this comment

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

не надо в самом файле определять поля + const pc = ...

import { HDD } from '../src/main';
describe("Testing Computer", () => {
it('Test to check the test operation', () => {
expect(Math.max(1, 5, 10)).toBe(10);
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,18 @@
function randElement(arr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

а почему js?

@@ -1,16 +1,20 @@
import { Phone } from './phone';
function randElement(arr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

вот тут нет еще 1 задания из полиморфизма

Copy link
Contributor

Choose a reason for hiding this comment

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

задание на создание списка (с указанием типа списка) и вызова абстрактного метода родительского класса в дочерних классах

@Kirill-Bokov Kirill-Bokov requested a review from jskonst December 15, 2023 14:39
@Kirill-Bokov Kirill-Bokov changed the title Частично решённые задания RPG Saga by Kirill Bokov Jan 13, 2024
@Kirill-Bokov Kirill-Bokov closed this by deleting the head repository May 21, 2024
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