-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssignment 1.txt
217 lines (187 loc) · 4.33 KB
/
Assignment 1.txt
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
enum PlayerName { Lucilla, Bert, Malina, Percy };
enum WeaponName { Broom, Scissors, Knife, Shovel, iPad };
enum EstateName { HauntedHouse, ManicManor, VisitationVilla, CalamityCastle, PerilPalace };
class HobbyDetectives
{
* -> * Square;
Guess solution;
* -> 4 Player;
* -> 2 Die;
int playerCount;
PlayerName currentTurn;
enum GameState { START, ONGOING, GUESS, WON, LOST };
GameState state;
void setup() {};
void createBoard() {};
void loop() {};
;
}
class Player
{
* -> 1 Character;
0..1 -- 1 Square;
* -> * Card;
enum State { PLAYING, ELIMINATED };
PlayerState state;
public Card revealCard(Guess guess){
}
public void doTurn(Die roll) {}
public Boolean makeSolveAttempt(Guess guess){
}
public Card makeGuess() {
}
}
class Character {
public Square move(){
}
}
class Square
{
* -> 0..1 Character;
* -> 4 Wall;
* -- 0..1 Estate;
}
class Weapon {
String name;
}
class Estate
{
1 -- 0..1 Weapon;
* -- 0..4 Character;
String name;
}
class Wall
{
enum Direction { North, East, South, West };
Direction direction;
}
interface Card
{
String getCardName();
}
class EstateCard
{
isA Card;
1 -- 1 Estate;
EstateName name;
String getCardName() {
return name.toString();
}
}
class CharacterCard
{
1 -- 1 Character;
isA Card;
PlayerName name;
String getCardName() {
return name.toString();
}
}
class WeaponCard
{
isA Card;
1 -- 1 Weapon;
WeaponName name;
String getCardName() {
return name.toString();
}
}
class Die {
int value;
int roll() {
value = (int) (Math.random() * 6) + 1;
return value;
}
}
class Guess
{
* -> 1 CharacterCard;
* -> 1 WeaponCard;
* -> 1 EstateCard;
}
//$?[End_of_model]$?
namespace -;
class HobbyDetectives
{
position 590 13 109 195.273;
position.association Card:solution__HobbyDetectives 0,68 195,50;
position.association Die:dice__HobbyDetectives 0,23 110,14;
position.association HobbyDetectives__Square:board 0,10 110,0;
position.association HobbyDetectives__Player:players 0,10 0,0;
position.association HobbyDetectives__Player 0,10 7,0;
position.association Die__HobbyDetectives 0,10 110,10;
position.association HobbyDetectives__Square 0,10 110,2;
}
class Player
{
position 438 243 283.659 127.982;
position.association Card:hand__Player 133,0 194,93;
position.association Player__Square:square 0,57 110,4;
position.association Estate:estate__Player 0,10 12,0;
position.association Player:player__Square:square 0,10 110,10;
position.association Character:character__Player 279,128 20,0;
position.association Character__Player 71,128 0,10;
position.association Player:player__Square 0,10 110,10;
position.association Player__Square 0,10 110,10;
}
class Square
{
position 190 275 109 60.6901;
position.association Square__Wall:walls 106,0 32,58;
position.association Estate:estate__Square 89,61 4,0;
position.association Estate__Square 93,61 6,0;
position.association Character:character__Square 110,11 0,10;
position.association Character__Square 110,10 0,10;
position.association Square__Wall 30,0 114,78;
}
class Estate
{
position 241 412 112.565 77.513;
position.association Estate__Square:squares 0,17 110,37;
position.association Estate__Weapon:weapon 0,29 113,23;
position.association Estate__Player:players 35,0 0,30;
position.association Estate__Weapon 0,11 113,7;
position.association Estate__Player 15,0 0,10;
position.association Character:characters__Estate 113,11 0,10;
position.association Character__Estate 113,28 0,10;
}
class Wall
{
position 147 151 152.682 77.513;
}
class EstateCard
{
position 814 250 194.622 94.3359;
position.association Estate__EstateCard 0,10 35,0;
}
class WeaponCard
{
position 800 351 194.622 150.82;
position.association Weapon__WeaponCard 0,10 110,0;
}
class Die
{
position 361 17 109 94.3359;
}
class Guess
{
position 67 41 109 60.6901;
position.association Guess__Player 109,61 0,47;
position.association EstateCard__Guess 110,10 0,10;
position.association Guess__PlayerCard 110,10 0,10;
position.association Guess__WeaponCard 110,10 0,10;
position.association CharacterCard__Guess 110,25 0,10;
}
class Character
{
position 543 417 146.628 77.513;
}
class Weapon
{
position 63 418 112.565 77.513;
}
class CharacterCard
{
position 820 126 194.622 94.3359;
position.association Character__CharacterCard 0,10 9,0;
}