export class Zone { zone: string; // Without the dot in the front min_length: number; length_1: number; length_2: number; price_buy_1?: number; price_buy_2?: number; price_auction_1?: number; price_auction_2?: number; address?: string; constructor(zone: string, price_buy_1?: number, price_buy_2?: number, price_auction_1?: number, price_auction_2?: number, min_length: number = 2, length_1: number = 3, length_2: number = 8, address?: string ) { this.zone = zone; this.min_length = min_length; this.length_1 = length_1; this.length_2 = length_2; this.price_buy_1 = price_buy_1; this.price_buy_2 = price_buy_2; this.price_auction_1 = price_auction_1; this.price_auction_2 = price_auction_2; this.address = address; } canBuy(): boolean { return this.price_buy_1 !== undefined && this.price_buy_1 !== null; } canAuction(): boolean { return this.price_auction_1 !== undefined && this.price_auction_1 !== null; } }