Поменял условия методов классов для корректной работы

related #5
parent d1c6a3fe
...@@ -10,7 +10,7 @@ export abstract class TruckState { ...@@ -10,7 +10,7 @@ export abstract class TruckState {
public abstract name: string; public abstract name: string;
public abstract changeDriver(driver: Driver): void; public abstract changeDriver(): void;
public abstract startRun(): void; public abstract startRun(): void;
......
...@@ -16,7 +16,7 @@ function getRandomDriver (): Driver { ...@@ -16,7 +16,7 @@ function getRandomDriver (): Driver {
export class InBaseState extends TruckState { export class InBaseState extends TruckState {
public name: string = 'На базе'; public name: string = 'На базе';
public changeDriver(driver: Driver): void { public changeDriver(): void {
this.truck.driver = getRandomDriver(); this.truck.driver = getRandomDriver();
console.log('Водитель поменян успешно'); console.log('Водитель поменян успешно');
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment