Began creating 'parent' components for the City and Location-specific parts of the UI

This commit is contained in:
danielyxie
2019-03-29 00:12:41 -07:00
parent 75bc34208c
commit 7172f4e527
16 changed files with 551 additions and 344 deletions
+23 -8
View File
@@ -10,29 +10,44 @@ export interface IConstructorParams {
name?: LocationName;
types?: LocationType[];
techVendorMaxRam?: number;
techVendorMinRam?: number;
}
export class Location {
// Name of city this location is in
// If this property is null, it means this is a generic Location that
// is available in all cities
/**
* Name of city this location is in. If this property is null, it means this i
* is a generic location that is available in all cities
*/
city: CityName | null = null;
// Identifier for location
/**
* Identifier for location
*/
name: LocationName = LocationName.Void;
// List of what type(s) this location is
// A location can be multiple types (e.g. company and tech vendor)
/**
* List of what type(s) this location is. A location can be multiple types
* (e.g. company and tech vendor)
*/
types: LocationType[] = [];
// Tech vendors allow you to purchase servers.
// This property defines the max RAM server you can purchase from this vendor
/**
* Tech vendors allow you to purchase servers.
* This property defines the max RAM server you can purchase from this vendor
*/
techVendorMaxRam: number = 0;
/**
* Tech vendors allow you to purchase servers.
* This property defines the max RAM server you can purchase from this vendor
*/
techVendorMinRam: number = 0;
constructor(p: IConstructorParams) {
if (p.city) { this.city = p.city; }
if (p.name) { this.name = p.name; }
if (p.types) { this.types = p.types; }
if (p.techVendorMaxRam) { this.techVendorMaxRam = p.techVendorMaxRam; }
if (p.techVendorMinRam) { this.techVendorMinRam = p.techVendorMinRam; }
}
}