billibox-vue/src/store/classes/Set.ts

46 lines
1.1 KiB
TypeScript

import InventoryItem from "@/store/classes/InventoryItem";
export default class Set extends InventoryItem {
private ADD_FIELDS = ['mount_key', 'autofocus', 'aperture_max', 'focal_length_min', 'focal_length_max' ];
private _mount_key: string;
private _autofocus: boolean;
private _aperture_max: number;
private _focal_length_min: number;
private _focal_length_max: number;
constructor(id:string, name:string, values?:Object) {
super(id, name, values);
this._item_type = "lens";
if(typeof values != "undefined") {
for (const field of this.ADD_FIELDS) {
if(field in values) this["_" + field] = values[field];
}
}
}
get mount_key(): string {
return this._mount_key;
}
get autofocus(): boolean {
return this._autofocus;
}
get aperture_max(): number {
return this._aperture_max;
}
get focal_length_min(): number {
return this._focal_length_min;
}
get focal_length_max(): number {
return this._focal_length_max;
}
}