2024-03-20 02:53:17 +01:00
|
|
|
import { IPetColorResult } from '@nitrots/api';
|
2022-11-02 09:25:40 +01:00
|
|
|
|
|
|
|
export class PetColorResult implements IPetColorResult
|
2021-03-17 03:02:09 +01:00
|
|
|
{
|
2021-06-07 07:01:12 +02:00
|
|
|
private static COLOR_TAGS: string[] = ['Null', 'Black', 'White', 'Grey', 'Red', 'Orange', 'Pink', 'Green', 'Lime', 'Blue', 'Light-Blue', 'Dark-Blue', 'Yellow', 'Brown', 'Dark-Brown', 'Beige', 'Cyan', 'Purple', 'Gold'];
|
2021-03-17 03:02:09 +01:00
|
|
|
|
|
|
|
private _breed: number;
|
|
|
|
private _tag: string;
|
|
|
|
private _id: string;
|
|
|
|
private _primaryColor: number;
|
|
|
|
private _secondaryColor: number;
|
|
|
|
private _isMaster: boolean;
|
|
|
|
private _layerTags: string[];
|
|
|
|
|
2021-05-22 18:16:52 +02:00
|
|
|
constructor(primaryColor: number, secondaryColor: number, breed: number, tag: number, id: string, isMaster: boolean, layerTags: string[])
|
2021-03-17 03:02:09 +01:00
|
|
|
{
|
2022-03-03 01:21:30 +01:00
|
|
|
this._layerTags = [];
|
|
|
|
this._primaryColor = (primaryColor & 0xFFFFFF);
|
|
|
|
this._secondaryColor = (secondaryColor & 0xFFFFFF);
|
|
|
|
this._breed = breed;
|
|
|
|
this._tag = (((tag > -1) && (tag < PetColorResult.COLOR_TAGS.length)) ? PetColorResult.COLOR_TAGS[tag] : '');
|
|
|
|
this._id = id;
|
|
|
|
this._isMaster = isMaster;
|
|
|
|
this._layerTags = layerTags;
|
2021-03-17 03:02:09 +01:00
|
|
|
}
|
|
|
|
|
2021-06-07 07:01:12 +02:00
|
|
|
public get primaryColor(): number
|
2021-03-17 03:02:09 +01:00
|
|
|
{
|
|
|
|
return this._primaryColor;
|
|
|
|
}
|
|
|
|
|
2021-06-07 07:01:12 +02:00
|
|
|
public get secondaryColor(): number
|
2021-03-17 03:02:09 +01:00
|
|
|
{
|
|
|
|
return this._secondaryColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
public get breed(): number
|
|
|
|
{
|
|
|
|
return this._breed;
|
|
|
|
}
|
|
|
|
|
|
|
|
public get tag(): string
|
|
|
|
{
|
|
|
|
return this._tag;
|
|
|
|
}
|
|
|
|
|
|
|
|
public get id(): string
|
|
|
|
{
|
|
|
|
return this._id;
|
|
|
|
}
|
|
|
|
|
2021-06-07 07:01:12 +02:00
|
|
|
public get isMaster(): boolean
|
2021-03-17 03:02:09 +01:00
|
|
|
{
|
|
|
|
return this._isMaster;
|
|
|
|
}
|
|
|
|
|
2021-06-07 07:01:12 +02:00
|
|
|
public get layerTags(): string[]
|
2021-03-17 03:02:09 +01:00
|
|
|
{
|
|
|
|
return this._layerTags;
|
|
|
|
}
|
2021-06-07 07:01:12 +02:00
|
|
|
}
|