-
Notifications
You must be signed in to change notification settings - Fork 3
/
location.js
43 lines (41 loc) · 1.18 KB
/
location.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"use strict";
//location card class
class Location {
//constructor
constructor(id, locationName, value, x, y) {
this.id = id;
this.locationName = locationName;
this.value = value;
this.x = x;
this.y = y;
// Get the right color and resource name for each location
switch (locationName) {
case "Hills":
this.color = "brown";
this.resourceName = "brick";
break;
case "Forest":
this.color = "darkgreen";
this.resourceName = "lumber";
break;
case "Mountains":
this.color = "grey";
this.resourceName = "ore";
break;
case "Fields":
this.color = "yellow";
this.resourceName = "grain";
break;
case "Pasture":
this.color = "lightgreen";
this.resourceName = "wool";
break;
case "Dessert":
this.color = "tan";
break;
default:
this.color = "red";
break;
}
}
}