//
// Vendor.m
// GoToBus
//
// Created by iphone development on 6/4/14.
//
//

#import "Vendor.h"
#import <AVFoundation/AVFoundation.h>
#import "Lang.h"
#import "SDK.h"

NSInteger const VendorIdCoachRun = 1350154;
NSInteger const VendorIdEastWestBus = 1867665;

@implementation Vendor

#pragma mark - Property

- (BOOL)sell_bus {
	return self.vendor_type & 1;
}

- (BOOL)sell_show {
	return self.vendor_type & 8;
}

- (BOOL)sell_hotel {
	return self.vendor_type & 4;
}

- (NSString *)availableMetadataObjectType {
	if (self.barcode_type == 1) {
		return AVMetadataObjectTypeQRCode;
	} else if (self.barcode_type == 2) {
		return AVMetadataObjectTypeInterleaved2of5Code;
	} else if (self.barcode_type == 7) {
		return AVMetadataObjectTypeCode39Code;
	} else if (self.barcode_type == 9) {
		return AVMetadataObjectTypeCode128Code;
	}
	return nil;
}

- (NSString *)availableCodeGenerator {
	if (self.barcode_type == 1) {
		return @"CIQRCodeGenerator";
	} else if (self.barcode_type == 9) {
		return @"CICode128BarcodeGenerator";
	}
	return nil;
}

@end
