17 lines
413 B
TypeScript
17 lines
413 B
TypeScript
export type CarClassType = 'formula' | 'gt' | 'prototype' | 'touring' | 'sports' | 'oval' | 'dirt';
|
|
|
|
export class CarClass {
|
|
private constructor(private readonly value: CarClassType) {}
|
|
|
|
static create(value: CarClassType): CarClass {
|
|
return new CarClass(value);
|
|
}
|
|
|
|
toString(): CarClassType {
|
|
return this.value;
|
|
}
|
|
|
|
equals(other: CarClass): boolean {
|
|
return this.value === other.value;
|
|
}
|
|
} |