1
2 package hoplugins.trainingExperience.constants;
3
4 import hoplugins.Commons;
5
6 import plugins.IHOMiniModel;
7 import plugins.ITeam;
8
9
10 /***
11 * Class the manage relation between trainingtype codes and description
12 *
13 * @author <a href=mailto:draghetto@users.sourceforge.net>Massimiliano Amato</a>
14 */
15 public class Trainings {
16
17
18 /***
19 * Returns the training code given the training description
20 *
21 * @param selection The training name
22 *
23 * @return training code
24 */
25 public static int getTrainingCode(String selection) {
26 int type = ITeam.TA_ALLGEMEIN;
27 IHOMiniModel p_IHMM_miniModel = Commons.getModel();
28
29
30
31 if (selection.equals(p_IHMM_miniModel.getResource().getProperty("Allgemein"))) {
32 type = ITeam.TA_ALLGEMEIN;
33 }
34
35 if (selection.equals(p_IHMM_miniModel.getResource().getProperty("Kondition"))) {
36 type = ITeam.TA_KONDITION;
37 }
38
39 if (selection.equals(p_IHMM_miniModel.getResource().getProperty("Standards"))) {
40 type = ITeam.TA_STANDARD;
41 }
42
43 if (selection.equals(p_IHMM_miniModel.getResource().getProperty("Verteidigung"))) {
44 type = ITeam.TA_VERTEIDIGUNG;
45 }
46
47 if (selection.equals(p_IHMM_miniModel.getResource().getProperty("Chancenverwertung"))) {
48 type = ITeam.TA_CHANCEN;
49 }
50
51 if (selection.equals(p_IHMM_miniModel.getResource().getProperty("Fluegelspiel"))) {
52 type = ITeam.TA_FLANKEN;
53 }
54
55 if (selection.equals(p_IHMM_miniModel.getResource().getProperty("Torschuss_Training"))) {
56 type = ITeam.TA_SCHUSSTRAINING;
57 }
58
59 if (selection.equals(p_IHMM_miniModel.getResource().getProperty("Passpiel"))) {
60 type = ITeam.TA_PASSSPIEL;
61 }
62
63 if (selection.equals(p_IHMM_miniModel.getResource().getProperty("Spielaufbau"))) {
64 type = ITeam.TA_SPIELAUFBAU;
65 }
66
67 if (selection.equals(p_IHMM_miniModel.getResource().getProperty("Torwart"))) {
68 type = ITeam.TA_TORWART;
69 }
70
71 if (selection.equals(p_IHMM_miniModel.getResource().getProperty("Steilpaesse"))) {
72 type = ITeam.TA_STEILPAESSE;
73 }
74
75 if (selection.equals(p_IHMM_miniModel.getResource().getProperty("Defensivpositionen"))) {
76 type = ITeam.TA_ABWEHRVERHALTEN;
77 }
78
79
80 if (selection.equals(p_IHMM_miniModel.getResource().getProperty("ExternalAttack"))) {
81 type = ITeam.TA_EXTERNALATTACK;
82 }
83
84 return type;
85 }
86
87 /***
88 * Returns training descriptions
89 *
90 * @param type training type
91 *
92 * @return String description
93 */
94 public static String getTrainingDescription(int type) {
95 IHOMiniModel p_IHMM_miniModel = Commons.getModel();
96 String selectedTrain = "";
97
98
99 if (type == ITeam.TA_ALLGEMEIN) {
100 selectedTrain = new String(p_IHMM_miniModel.getResource().getProperty("Allgemein"));
101 }
102
103 if (type == ITeam.TA_KONDITION) {
104 selectedTrain = new String(p_IHMM_miniModel.getResource().getProperty("Kondition"));
105 }
106
107 if (type == ITeam.TA_STANDARD) {
108 selectedTrain = new String(p_IHMM_miniModel.getResource().getProperty("Standards"));
109 }
110
111 if (type == ITeam.TA_VERTEIDIGUNG) {
112 selectedTrain = new String(p_IHMM_miniModel.getResource().getProperty("Verteidigung"));
113 }
114
115 if (type == ITeam.TA_CHANCEN) {
116 selectedTrain = new String(p_IHMM_miniModel.getResource().getProperty("Chancenverwertung"));
117 }
118
119 if (type == ITeam.TA_FLANKEN) {
120 selectedTrain = new String(p_IHMM_miniModel.getResource().getProperty("Fluegelspiel"));
121 }
122
123 if (type == ITeam.TA_SCHUSSTRAINING) {
124 selectedTrain = new String(p_IHMM_miniModel.getResource().getProperty("Torschuss_Training"));
125 }
126
127 if (type == ITeam.TA_PASSSPIEL) {
128 selectedTrain = new String(p_IHMM_miniModel.getResource().getProperty("Passpiel"));
129 }
130
131 if (type == ITeam.TA_SPIELAUFBAU) {
132 selectedTrain = new String(p_IHMM_miniModel.getResource().getProperty("Spielaufbau"));
133 }
134
135 if (type == ITeam.TA_TORWART) {
136 selectedTrain = new String(p_IHMM_miniModel.getResource().getProperty("Torwart"));
137 }
138
139 if (type == ITeam.TA_STEILPAESSE) {
140 selectedTrain = new String(p_IHMM_miniModel.getResource().getProperty("Steilpaesse"));
141 }
142
143 if (type == ITeam.TA_ABWEHRVERHALTEN) {
144 selectedTrain = new String(p_IHMM_miniModel.getResource().getProperty("Defensivpositionen"));
145 }
146
147 if (type == ITeam.TA_EXTERNALATTACK) {
148 selectedTrain = new String(""
149 + p_IHMM_miniModel.getResource().getProperty("ExternalAttack"));
150 }
151
152 return selectedTrain;
153 }
154 }