1 package org.inigma.utopia;
2
3 import java.util.Calendar;
4 import java.util.UUID;
5
6 import org.inigma.utopia.utils.CalendarUtils;
7
8
9
10
11
12 public class Science {
13 public static final double ALCHEMY_FACTOR = 1.4;
14 public static final double TOOLS_FACTOR = 1;
15 public static final double HOUSING_FACTOR = 0.65;
16 public static final double FOOD_FACTOR = 8;
17 public static final double MILITARY_FACTOR = 1.4;
18 public static final double CRIME_FACTOR = 6;
19 public static final double CHANNELING_FACTOR = 6;
20
21 private String id;
22 private Province province;
23 private int alchemy;
24 private int tools;
25 private int housing;
26 private int food;
27 private int military;
28 private int crime;
29 private int channeling;
30 private Calendar lastUpdate;
31
32 public Science() {
33 this.id = UUID.randomUUID().toString();
34 this.lastUpdate = CalendarUtils.getCalendar();
35 this.lastUpdate.setTimeInMillis(0);
36 }
37
38 public Science(Province province) {
39 this();
40 this.province = province;
41 }
42
43 public void copy(Science data) {
44 alchemy = data.alchemy;
45 channeling = data.channeling;
46 crime = data.crime;
47 food = data.food;
48 housing = data.housing;
49 lastUpdate = data.lastUpdate;
50 military = data.military;
51 tools = data.tools;
52 }
53
54 public int getAlchemy() {
55 return alchemy;
56 }
57
58 public int getChanneling() {
59 return channeling;
60 }
61
62 public int getCrime() {
63 return crime;
64 }
65
66 public int getFood() {
67 return food;
68 }
69
70 public int getHousing() {
71 return housing;
72 }
73
74 public String getId() {
75 return id;
76 }
77
78 public Calendar getLastUpdate() {
79 return lastUpdate;
80 }
81
82 public int getMilitary() {
83 return military;
84 }
85
86 public Province getProvince() {
87 return province;
88 }
89
90 public int getTools() {
91 return tools;
92 }
93
94 public void setAlchemy(int alchemy) {
95 this.alchemy = alchemy;
96 }
97
98 public void setChanneling(int channeling) {
99 this.channeling = channeling;
100 }
101
102 public void setCrime(int crime) {
103 this.crime = crime;
104 }
105
106 public void setFood(int food) {
107 this.food = food;
108 }
109
110 public void setHousing(int housing) {
111 this.housing = housing;
112 }
113
114 public void setId(String id) {
115 this.id = id;
116 }
117
118 public void setLastUpdate(Calendar lastUpdate) {
119 this.lastUpdate = CalendarUtils.getCalendar(lastUpdate);
120 }
121
122 public void setMilitary(int military) {
123 this.military = military;
124 }
125
126 public void setProvince(Province province) {
127 this.province = province;
128 }
129
130 public void setTools(int tools) {
131 this.tools = tools;
132 }
133 }