Skip to content

Commit

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

constructor(age: number, name: string, breed: string) {
this.age = age;
this.name = name;
this.breed = breed;
}
set Age(age: number){
this.age = age;
}

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

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

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

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

get Breed(): string {
return this.breed;
}
getInfo(): string {
return `Имя: ${this.name}; Порода: ${this.breed}; Возраст: ${this.age}.`
}
}

0 comments on commit 15062f9

Please sign in to comment.