Skip to content

Commit

Permalink
Update cat.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
EgoriusTheGreat2 authored Nov 6, 2023
1 parent 15062f9 commit 26acc05
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions rpgsaga/saga/src/cat.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,46 @@
export class Cat {
private age: number;
private name: string;
private breed: string;
private theAge: number;
private theName: string;
private theBreed: string;
private theWeight: number;

constructor(age: number, name: string, breed: string) {
this.age = age;
this.name = name;
this.breed = breed;
constructor(age: number, name: string, breed: string, weight: number) {
this.theAge = age;
this.theName = name;
this.theBreed = breed;
this.theWeight = weight;
}
set Age(age: number){
this.age = age;
this.theAge = age;
}

get Age(): number {
return this.age;
return this.theAge;
}

set Name(name: string){
this.name = name;
this.theName = name;
}

get Name(): string {
return this.name;
return this.theName;
}

set Breed(breed: string){
this.breed = breed;
this.theBreed = breed;
}

get Breed(): string {
return this.breed;
return this.theBreed;
}
set Weight(weight: number){
this.theWeight = weight;
}

get Weight(): number{
return this.theWeight;
}
getInfo(): string {
return `Имя: ${this.name}; Порода: ${this.breed}; Возраст: ${this.age}.`
return `Имя: ${this.theName}; Порода: ${this.theBreed}; Возраст: ${this.theAge}; Вес:${this.theWeight}.`
}
}

0 comments on commit 26acc05

Please sign in to comment.