View Javadoc

1   // %1203618038:hoplugins.trainingExperience.vo%
2   package hoplugins.trainingExperience.vo;
3   
4   /***
5    * This value object represents a week of training. It contains the last hrf id before a training
6    * update and the first hrf id after the update. It also contains the effect of the training as a
7    * seperate value object.
8    *
9    * @author NetHyperon
10   */
11  public class TrainWeekEffect {
12      //~ Instance fields ----------------------------------------------------------------------------
13  
14      /*** Average form */
15      private double avgForm;
16  
17      /*** Average TSI */
18      private int avgTSI;
19  
20      /*** Value for total decrease in form */
21      private int formDecrease;
22  
23      /*** Value for total increase in form */
24      private int formIncrease;
25  
26      /*** HRF id after training update */
27      private int hrfIdAfter;
28  
29      /*** HRF id before training update */
30      private int hrfIdBefore;
31  
32      /*** Number of skillups */
33      private int skillups;
34  
35      /*** Value for total TSI */
36      private int totalTSI;
37  
38      /*** Training season */
39      private int trainseason;
40  
41      /*** Training week */
42      private int trainweek;
43  
44      /*** Value for total decrease in TSI */
45      private int tsiDecrease;
46  
47      /*** Value for total increase in TSI */
48      private int tsiIncrease;
49  
50      //~ Constructors -------------------------------------------------------------------------------
51  
52      /***
53       * Creates a new TrainWeek object.
54       *
55       * @param week Training week
56       * @param season TODO Missing Constructuor Parameter Documentation
57       * @param beforeHRF HRF id before training update
58       * @param afterHRF HRF id after training update
59       */
60      public TrainWeekEffect(int week, int season, int beforeHRF, int afterHRF) {
61          this.hrfIdBefore = beforeHRF;
62          this.hrfIdAfter = afterHRF;
63          this.trainweek = week;
64          this.trainseason = season;
65      }
66  
67      //~ Methods ------------------------------------------------------------------------------------
68  
69      /***
70       * Set the amount of skillups
71       *
72       * @param amount Amount of skillups
73       */
74      public void setAmountSkillups(int amount) {
75          this.skillups = amount;
76      }
77  
78      /***
79       * Get the amount of skillups
80       *
81       * @return Amount of skillups
82       */
83      public int getAmountSkillups() {
84          return skillups;
85      }
86  
87      /***
88       * Set the average form
89       *
90       * @param avgForm Average form
91       */
92      public void setAverageForm(double avgForm) {
93          this.avgForm = avgForm;
94      }
95  
96      /***
97       * Get the avarage form
98       *
99       * @return Average form
100      */
101     public double getAverageForm() {
102         return avgForm;
103     }
104 
105     /***
106      * Set the average TSI
107      *
108      * @param avgTSI Average TSI
109      */
110     public void setAverageTSI(int avgTSI) {
111         this.avgTSI = avgTSI;
112     }
113 
114     /***
115      * Get the avarage TSI
116      *
117      * @return Average TSI
118      */
119     public int getAverageTSI() {
120         return avgTSI;
121     }
122 
123     /***
124      * Get the total decrease in form
125      *
126      * @return Form decrease
127      */
128     public int getFormDecrease() {
129         return formDecrease;
130     }
131 
132     /***
133      * Get the total increase in form
134      *
135      * @return Form increase
136      */
137     public int getFormIncrease() {
138         return formIncrease;
139     }
140 
141     /***
142      * Get the HRF id after the training update
143      *
144      * @return id
145      */
146     public int getHRFafterUpdate() {
147         return this.hrfIdAfter;
148     }
149 
150     /***
151      * Get the HRF id before the training update
152      *
153      * @return id
154      */
155     public int getHRFbeforeUpdate() {
156         return this.hrfIdBefore;
157     }
158 
159     /***
160      * Get the training HT season
161      *
162      * @return Training HT season
163      */
164     public int getHattrickSeason() {
165         return trainseason;
166     }
167 
168     /***
169      * Get the training HT week
170      *
171      * @return Training HT week
172      */
173     public int getHattrickWeek() {
174         return trainweek;
175     }
176 
177     /***
178      * Get the total decrease in TSI
179      *
180      * @return TSI decrease
181      */
182     public int getTSIDecrease() {
183         return tsiDecrease;
184     }
185 
186     /***
187      * Get the total increase in TSI
188      *
189      * @return TSI increase
190      */
191     public int getTSIIncrease() {
192         return tsiIncrease;
193     }
194 
195     /***
196      * Set the total TSI
197      *
198      * @param totalTSI Total TSI
199      */
200     public void setTotalTSI(int totalTSI) {
201         this.totalTSI = totalTSI;
202     }
203 
204     /***
205      * Get the total TSI
206      *
207      * @return Total TSI
208      */
209     public int getTotalTSI() {
210         return totalTSI;
211     }
212 
213     /***
214      * Add a form value, depending on the value it will be added to the increase or decrease.
215      *
216      * @param value Form value to add
217      */
218     public void addForm(int value) {
219         if (value > 0) {
220             this.formIncrease += value;
221         } else if (value < 0) {
222             this.formDecrease += value;
223         }
224     }
225 
226     /***
227      * Add a TSI value, depending on the value it will be added to the increase or decrease.
228      *
229      * @param value TSI value to add
230      */
231     public void addTSI(int value) {
232         if (value > 0) {
233             this.tsiIncrease += value;
234         } else if (value < 0) {
235             this.tsiDecrease += value;
236         }
237     }
238 
239     /***
240      * TODO Missing Method Documentation
241      *
242      * @return TODO Missing Return Method Documentation
243      */
244     public String toString() {
245         StringBuffer buffer = new StringBuffer();
246 
247         buffer.append("TrainWeekEffect[");
248         buffer.append(" HT season = " + trainseason);
249         buffer.append(", HT week = " + trainweek);
250         buffer.append(", hrf before = " + hrfIdBefore);
251         buffer.append(", hrf after = " + hrfIdAfter);
252         buffer.append("]");
253 
254         return buffer.toString();
255     }
256 }