├── .gitignore
├── LICENSE
├── README.md
├── bot.json
├── compile.bat
├── compile.sh
├── output
├── map.txt
└── state.json
├── pom.xml
├── run.bat
├── run.sh
└── src
├── main
├── java
│ └── za
│ │ └── co
│ │ └── entelect
│ │ └── challenge
│ │ ├── bot
│ │ └── BasicBot.java
│ │ ├── dto
│ │ ├── AlienManager.java
│ │ ├── BuildingsAvailable.java
│ │ ├── GameState.java
│ │ ├── Map.java
│ │ ├── Missile.java
│ │ ├── Player.java
│ │ ├── Row.java
│ │ ├── Settings.java
│ │ ├── Ship.java
│ │ ├── Wave.java
│ │ ├── enums
│ │ │ ├── EntityType.java
│ │ │ └── ShipCommand.java
│ │ └── reader
│ │ │ ├── BasicGameStateReader.java
│ │ │ ├── GameStateReader.java
│ │ │ ├── GsonGameStateReader.java
│ │ │ └── JacksonGameStateReader.java
│ │ ├── program
│ │ └── Main.java
│ │ └── utils
│ │ ├── BotHelper.java
│ │ ├── FileHelper.java
│ │ ├── LogHelper.java
│ │ └── StringUtility.java
└── resources
│ └── settings.properties
└── test
├── java
└── za
│ └── co
│ └── entelect
│ └── challenge
│ └── dto
│ └── GameStateParsingTest.java
└── resources
└── state.json
/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | .settings/**
4 | *.iml
5 | .idea
6 | **/target
7 | **/advanced/bot
8 | **/expert/bot
9 | logs
10 | **/*.log
11 | output/move.txt
12 | /target/
13 | **/*.class
14 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Entelect Challenge
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Java
2 | If you plan to develop your entry in Java you need to download and install the latest [Java 8 Development Kit](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html).
3 |
4 | The sample bot also uses Maven for building and dependency management - detailed instructions for installing it are provided below.
5 |
6 | ## Maven Installation
7 | Installation is fairly simple:
8 | * Maven is free software that can be downloaded [here](http://maven.apache.org/download.cgi) (local mirrors are available).
9 | * Install as per the included README.txt:
10 | * Ensure the JAVA_HOME environment variable is set to the root of your JDK installation (eg. on Windows: C:\\Program Files\\Java\\jdk8).
11 | * Extract the .zip / .tar.gz archive.
12 | * Add the bin folder from the extracted directory to your path.
13 | * Verify that the installation is working by starting a new command line and running `mvn --version` it should output something similar to:
14 | ```powershell
15 | Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; 2015-03-13T22:10:27+02:00)
16 | Maven home: c:\DevTools\Java\maven-3.3.1
17 | Java version: 1.8.0_40, vendor: Oracle Corporation
18 | Java home: c:\DevTools\Java\jdk8u40\jre
19 | Default locale: en_GB, platform encoding: Cp1252
20 | OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
21 | ```
22 |
23 | If you need to use any libraries in your bot simply include the dependencies in your project's pom.xml.
24 |
25 | ## Get The Code
26 | Download the [zip file](https://github.com/EntelectChallenge/2015-SpaceInvaders-Bot-Java/archive/master.zip) from Github or use Git to clone the repository:
27 | * Start Git Bash
28 | * Change to the directory where you want to checkout the sample bot
29 | * Run: `git clone https://github.com/EntelectChallenge/2015-SpaceInvaders-Bot-Java.git`
30 |
31 | ## Compile
32 | The easiest way to compile is to open a Command Prompt, change to your bot folder and run `compile.bat`. This will use Maven to fetch your dependencies and build your bot.
33 |
34 | ## Run
35 | Once you have compiled you can do a basic test of the bot by simply launching a Command Prompt, changing to the bot directory and running `run.bat output`. This will use the example state and map files in the output folder.
--------------------------------------------------------------------------------
/bot.json:
--------------------------------------------------------------------------------
1 | {
2 | "Author": "Entelect",
3 | "Email": "",
4 | "NickName": "Java QS Bot"
5 | }
--------------------------------------------------------------------------------
/compile.bat:
--------------------------------------------------------------------------------
1 | mvn clean compile assembly:single
--------------------------------------------------------------------------------
/compile.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | mvn clean compile assembly:single
4 |
--------------------------------------------------------------------------------
/output/map.txt:
--------------------------------------------------------------------------------
1 | ###################
2 | # C# Sample Bot #
3 | # Round: 33 #
4 | # Kills: 1 #
5 | # Lives: 0 #
6 | # Missiles: 1/2 #
7 | ###################
8 | # | MMM #
9 | # VVV #
10 | # --- - --- #
11 | # --- --- --- #
12 | # -- -- --- #
13 | # #
14 | # #
15 | # x x #
16 | # i #
17 | # x x x x #
18 | # #
19 | # #
20 | # x x x #
21 | # #
22 | # x x #
23 | # ! #
24 | # #
25 | # #
26 | # -- - - --- #
27 | # --- - -- --- #
28 | # --- -- --- #
29 | # AAA #
30 | # XXX #
31 | ###################
32 | # Missiles: 1/1 #
33 | # Lives: 0 #
34 | # Kills: 1 #
35 | # Round: 33 #
36 | # Node Sample Bot #
37 | ###################
38 |
39 |
--------------------------------------------------------------------------------
/output/state.json:
--------------------------------------------------------------------------------
1 | {
2 | "BuildingsAvailable": [
3 | {
4 | "Command": "BuildAlienFactory",
5 | "Type": "AlienFactory",
6 | "Cost": 1
7 | },
8 | {
9 | "Command": "BuildMissileController",
10 | "Type": "MissileController",
11 | "Cost": 1
12 | },
13 | {
14 | "Command": "BuildShield",
15 | "Type": "Shield",
16 | "Cost": 1
17 | }
18 | ],
19 | "Map": {
20 | "Width": 19,
21 | "Height": 25,
22 | "Rows": [
23 | [
24 | {
25 | "Id": 1,
26 | "Alive": true,
27 | "X": 0,
28 | "Y": 0,
29 | "Width": 1,
30 | "Height": 1,
31 | "Type": "Wall",
32 | "PlayerNumber": 0
33 | },
34 | {
35 | "Id": 2,
36 | "Alive": true,
37 | "X": 1,
38 | "Y": 0,
39 | "Width": 1,
40 | "Height": 1,
41 | "Type": "Wall",
42 | "PlayerNumber": 0
43 | },
44 | {
45 | "Id": 3,
46 | "Alive": true,
47 | "X": 2,
48 | "Y": 0,
49 | "Width": 1,
50 | "Height": 1,
51 | "Type": "Wall",
52 | "PlayerNumber": 0
53 | },
54 | {
55 | "Id": 4,
56 | "Alive": true,
57 | "X": 3,
58 | "Y": 0,
59 | "Width": 1,
60 | "Height": 1,
61 | "Type": "Wall",
62 | "PlayerNumber": 0
63 | },
64 | {
65 | "Id": 5,
66 | "Alive": true,
67 | "X": 4,
68 | "Y": 0,
69 | "Width": 1,
70 | "Height": 1,
71 | "Type": "Wall",
72 | "PlayerNumber": 0
73 | },
74 | {
75 | "Id": 6,
76 | "Alive": true,
77 | "X": 5,
78 | "Y": 0,
79 | "Width": 1,
80 | "Height": 1,
81 | "Type": "Wall",
82 | "PlayerNumber": 0
83 | },
84 | {
85 | "Id": 7,
86 | "Alive": true,
87 | "X": 6,
88 | "Y": 0,
89 | "Width": 1,
90 | "Height": 1,
91 | "Type": "Wall",
92 | "PlayerNumber": 0
93 | },
94 | {
95 | "Id": 8,
96 | "Alive": true,
97 | "X": 7,
98 | "Y": 0,
99 | "Width": 1,
100 | "Height": 1,
101 | "Type": "Wall",
102 | "PlayerNumber": 0
103 | },
104 | {
105 | "Id": 9,
106 | "Alive": true,
107 | "X": 8,
108 | "Y": 0,
109 | "Width": 1,
110 | "Height": 1,
111 | "Type": "Wall",
112 | "PlayerNumber": 0
113 | },
114 | {
115 | "Id": 10,
116 | "Alive": true,
117 | "X": 9,
118 | "Y": 0,
119 | "Width": 1,
120 | "Height": 1,
121 | "Type": "Wall",
122 | "PlayerNumber": 0
123 | },
124 | {
125 | "Id": 11,
126 | "Alive": true,
127 | "X": 10,
128 | "Y": 0,
129 | "Width": 1,
130 | "Height": 1,
131 | "Type": "Wall",
132 | "PlayerNumber": 0
133 | },
134 | {
135 | "Id": 12,
136 | "Alive": true,
137 | "X": 11,
138 | "Y": 0,
139 | "Width": 1,
140 | "Height": 1,
141 | "Type": "Wall",
142 | "PlayerNumber": 0
143 | },
144 | {
145 | "Id": 13,
146 | "Alive": true,
147 | "X": 12,
148 | "Y": 0,
149 | "Width": 1,
150 | "Height": 1,
151 | "Type": "Wall",
152 | "PlayerNumber": 0
153 | },
154 | {
155 | "Id": 14,
156 | "Alive": true,
157 | "X": 13,
158 | "Y": 0,
159 | "Width": 1,
160 | "Height": 1,
161 | "Type": "Wall",
162 | "PlayerNumber": 0
163 | },
164 | {
165 | "Id": 15,
166 | "Alive": true,
167 | "X": 14,
168 | "Y": 0,
169 | "Width": 1,
170 | "Height": 1,
171 | "Type": "Wall",
172 | "PlayerNumber": 0
173 | },
174 | {
175 | "Id": 16,
176 | "Alive": true,
177 | "X": 15,
178 | "Y": 0,
179 | "Width": 1,
180 | "Height": 1,
181 | "Type": "Wall",
182 | "PlayerNumber": 0
183 | },
184 | {
185 | "Id": 17,
186 | "Alive": true,
187 | "X": 16,
188 | "Y": 0,
189 | "Width": 1,
190 | "Height": 1,
191 | "Type": "Wall",
192 | "PlayerNumber": 0
193 | },
194 | {
195 | "Id": 18,
196 | "Alive": true,
197 | "X": 17,
198 | "Y": 0,
199 | "Width": 1,
200 | "Height": 1,
201 | "Type": "Wall",
202 | "PlayerNumber": 0
203 | },
204 | {
205 | "Id": 19,
206 | "Alive": true,
207 | "X": 18,
208 | "Y": 0,
209 | "Width": 1,
210 | "Height": 1,
211 | "Type": "Wall",
212 | "PlayerNumber": 0
213 | }
214 | ],
215 | [
216 | {
217 | "Id": 20,
218 | "Alive": true,
219 | "X": 0,
220 | "Y": 1,
221 | "Width": 1,
222 | "Height": 1,
223 | "Type": "Wall",
224 | "PlayerNumber": 0
225 | },
226 | null,
227 | null,
228 | null,
229 | null,
230 | null,
231 | {
232 | "Id": 169,
233 | "Alive": true,
234 | "X": 6,
235 | "Y": 1,
236 | "Width": 1,
237 | "Height": 1,
238 | "Type": "Bullet",
239 | "PlayerNumber": 1
240 | },
241 | null,
242 | {
243 | "LivesCost": 1,
244 | "Id": 140,
245 | "Alive": true,
246 | "X": 8,
247 | "Y": 1,
248 | "Width": 3,
249 | "Height": 1,
250 | "Type": "MissileController",
251 | "PlayerNumber": 2
252 | },
253 | {
254 | "LivesCost": 1,
255 | "Id": 140,
256 | "Alive": true,
257 | "X": 8,
258 | "Y": 1,
259 | "Width": 3,
260 | "Height": 1,
261 | "Type": "MissileController",
262 | "PlayerNumber": 2
263 | },
264 | {
265 | "LivesCost": 1,
266 | "Id": 140,
267 | "Alive": true,
268 | "X": 8,
269 | "Y": 1,
270 | "Width": 3,
271 | "Height": 1,
272 | "Type": "MissileController",
273 | "PlayerNumber": 2
274 | },
275 | null,
276 | null,
277 | null,
278 | null,
279 | null,
280 | null,
281 | null,
282 | {
283 | "Id": 21,
284 | "Alive": true,
285 | "X": 18,
286 | "Y": 1,
287 | "Width": 1,
288 | "Height": 1,
289 | "Type": "Wall",
290 | "PlayerNumber": 0
291 | }
292 | ],
293 | [
294 | {
295 | "Id": 22,
296 | "Alive": true,
297 | "X": 0,
298 | "Y": 2,
299 | "Width": 1,
300 | "Height": 1,
301 | "Type": "Wall",
302 | "PlayerNumber": 0
303 | },
304 | null,
305 | null,
306 | null,
307 | null,
308 | null,
309 | null,
310 | {
311 | "Command": "Nothing",
312 | "CommandFeedback": "Tried to build a building but didn't have enough lives.",
313 | "Id": 86,
314 | "Alive": true,
315 | "X": 7,
316 | "Y": 2,
317 | "Width": 3,
318 | "Height": 1,
319 | "Type": "Ship",
320 | "PlayerNumber": 2
321 | },
322 | {
323 | "Command": "Nothing",
324 | "CommandFeedback": "Tried to build a building but didn't have enough lives.",
325 | "Id": 86,
326 | "Alive": true,
327 | "X": 7,
328 | "Y": 2,
329 | "Width": 3,
330 | "Height": 1,
331 | "Type": "Ship",
332 | "PlayerNumber": 2
333 | },
334 | {
335 | "Command": "Nothing",
336 | "CommandFeedback": "Tried to build a building but didn't have enough lives.",
337 | "Id": 86,
338 | "Alive": true,
339 | "X": 7,
340 | "Y": 2,
341 | "Width": 3,
342 | "Height": 1,
343 | "Type": "Ship",
344 | "PlayerNumber": 2
345 | },
346 | null,
347 | null,
348 | null,
349 | null,
350 | null,
351 | null,
352 | null,
353 | null,
354 | {
355 | "Id": 23,
356 | "Alive": true,
357 | "X": 18,
358 | "Y": 2,
359 | "Width": 1,
360 | "Height": 1,
361 | "Type": "Wall",
362 | "PlayerNumber": 0
363 | }
364 | ],
365 | [
366 | {
367 | "Id": 24,
368 | "Alive": true,
369 | "X": 0,
370 | "Y": 3,
371 | "Width": 1,
372 | "Height": 1,
373 | "Type": "Wall",
374 | "PlayerNumber": 0
375 | },
376 | null,
377 | {
378 | "Id": 105,
379 | "Alive": true,
380 | "X": 2,
381 | "Y": 3,
382 | "Width": 1,
383 | "Height": 1,
384 | "Type": "Shield",
385 | "PlayerNumber": 2
386 | },
387 | {
388 | "Id": 108,
389 | "Alive": true,
390 | "X": 3,
391 | "Y": 3,
392 | "Width": 1,
393 | "Height": 1,
394 | "Type": "Shield",
395 | "PlayerNumber": 2
396 | },
397 | {
398 | "Id": 111,
399 | "Alive": true,
400 | "X": 4,
401 | "Y": 3,
402 | "Width": 1,
403 | "Height": 1,
404 | "Type": "Shield",
405 | "PlayerNumber": 2
406 | },
407 | null,
408 | null,
409 | null,
410 | null,
411 | {
412 | "Id": 134,
413 | "Alive": true,
414 | "X": 9,
415 | "Y": 3,
416 | "Width": 1,
417 | "Height": 1,
418 | "Type": "Shield",
419 | "PlayerNumber": 2
420 | },
421 | null,
422 | null,
423 | null,
424 | null,
425 | {
426 | "Id": 114,
427 | "Alive": true,
428 | "X": 14,
429 | "Y": 3,
430 | "Width": 1,
431 | "Height": 1,
432 | "Type": "Shield",
433 | "PlayerNumber": 2
434 | },
435 | {
436 | "Id": 117,
437 | "Alive": true,
438 | "X": 15,
439 | "Y": 3,
440 | "Width": 1,
441 | "Height": 1,
442 | "Type": "Shield",
443 | "PlayerNumber": 2
444 | },
445 | {
446 | "Id": 120,
447 | "Alive": true,
448 | "X": 16,
449 | "Y": 3,
450 | "Width": 1,
451 | "Height": 1,
452 | "Type": "Shield",
453 | "PlayerNumber": 2
454 | },
455 | null,
456 | {
457 | "Id": 25,
458 | "Alive": true,
459 | "X": 18,
460 | "Y": 3,
461 | "Width": 1,
462 | "Height": 1,
463 | "Type": "Wall",
464 | "PlayerNumber": 0
465 | }
466 | ],
467 | [
468 | {
469 | "Id": 26,
470 | "Alive": true,
471 | "X": 0,
472 | "Y": 4,
473 | "Width": 1,
474 | "Height": 1,
475 | "Type": "Wall",
476 | "PlayerNumber": 0
477 | },
478 | null,
479 | {
480 | "Id": 106,
481 | "Alive": true,
482 | "X": 2,
483 | "Y": 4,
484 | "Width": 1,
485 | "Height": 1,
486 | "Type": "Shield",
487 | "PlayerNumber": 2
488 | },
489 | {
490 | "Id": 109,
491 | "Alive": true,
492 | "X": 3,
493 | "Y": 4,
494 | "Width": 1,
495 | "Height": 1,
496 | "Type": "Shield",
497 | "PlayerNumber": 2
498 | },
499 | {
500 | "Id": 112,
501 | "Alive": true,
502 | "X": 4,
503 | "Y": 4,
504 | "Width": 1,
505 | "Height": 1,
506 | "Type": "Shield",
507 | "PlayerNumber": 2
508 | },
509 | null,
510 | null,
511 | null,
512 | {
513 | "Id": 132,
514 | "Alive": true,
515 | "X": 8,
516 | "Y": 4,
517 | "Width": 1,
518 | "Height": 1,
519 | "Type": "Shield",
520 | "PlayerNumber": 2
521 | },
522 | {
523 | "Id": 135,
524 | "Alive": true,
525 | "X": 9,
526 | "Y": 4,
527 | "Width": 1,
528 | "Height": 1,
529 | "Type": "Shield",
530 | "PlayerNumber": 2
531 | },
532 | {
533 | "Id": 138,
534 | "Alive": true,
535 | "X": 10,
536 | "Y": 4,
537 | "Width": 1,
538 | "Height": 1,
539 | "Type": "Shield",
540 | "PlayerNumber": 2
541 | },
542 | null,
543 | null,
544 | null,
545 | {
546 | "Id": 115,
547 | "Alive": true,
548 | "X": 14,
549 | "Y": 4,
550 | "Width": 1,
551 | "Height": 1,
552 | "Type": "Shield",
553 | "PlayerNumber": 2
554 | },
555 | {
556 | "Id": 118,
557 | "Alive": true,
558 | "X": 15,
559 | "Y": 4,
560 | "Width": 1,
561 | "Height": 1,
562 | "Type": "Shield",
563 | "PlayerNumber": 2
564 | },
565 | {
566 | "Id": 121,
567 | "Alive": true,
568 | "X": 16,
569 | "Y": 4,
570 | "Width": 1,
571 | "Height": 1,
572 | "Type": "Shield",
573 | "PlayerNumber": 2
574 | },
575 | null,
576 | {
577 | "Id": 27,
578 | "Alive": true,
579 | "X": 18,
580 | "Y": 4,
581 | "Width": 1,
582 | "Height": 1,
583 | "Type": "Wall",
584 | "PlayerNumber": 0
585 | }
586 | ],
587 | [
588 | {
589 | "Id": 28,
590 | "Alive": true,
591 | "X": 0,
592 | "Y": 5,
593 | "Width": 1,
594 | "Height": 1,
595 | "Type": "Wall",
596 | "PlayerNumber": 0
597 | },
598 | null,
599 | {
600 | "Id": 107,
601 | "Alive": true,
602 | "X": 2,
603 | "Y": 5,
604 | "Width": 1,
605 | "Height": 1,
606 | "Type": "Shield",
607 | "PlayerNumber": 2
608 | },
609 | {
610 | "Id": 110,
611 | "Alive": true,
612 | "X": 3,
613 | "Y": 5,
614 | "Width": 1,
615 | "Height": 1,
616 | "Type": "Shield",
617 | "PlayerNumber": 2
618 | },
619 | null,
620 | null,
621 | null,
622 | null,
623 | null,
624 | {
625 | "Id": 136,
626 | "Alive": true,
627 | "X": 9,
628 | "Y": 5,
629 | "Width": 1,
630 | "Height": 1,
631 | "Type": "Shield",
632 | "PlayerNumber": 2
633 | },
634 | {
635 | "Id": 139,
636 | "Alive": true,
637 | "X": 10,
638 | "Y": 5,
639 | "Width": 1,
640 | "Height": 1,
641 | "Type": "Shield",
642 | "PlayerNumber": 2
643 | },
644 | null,
645 | null,
646 | null,
647 | {
648 | "Id": 116,
649 | "Alive": true,
650 | "X": 14,
651 | "Y": 5,
652 | "Width": 1,
653 | "Height": 1,
654 | "Type": "Shield",
655 | "PlayerNumber": 2
656 | },
657 | {
658 | "Id": 119,
659 | "Alive": true,
660 | "X": 15,
661 | "Y": 5,
662 | "Width": 1,
663 | "Height": 1,
664 | "Type": "Shield",
665 | "PlayerNumber": 2
666 | },
667 | {
668 | "Id": 122,
669 | "Alive": true,
670 | "X": 16,
671 | "Y": 5,
672 | "Width": 1,
673 | "Height": 1,
674 | "Type": "Shield",
675 | "PlayerNumber": 2
676 | },
677 | null,
678 | {
679 | "Id": 29,
680 | "Alive": true,
681 | "X": 18,
682 | "Y": 5,
683 | "Width": 1,
684 | "Height": 1,
685 | "Type": "Wall",
686 | "PlayerNumber": 0
687 | }
688 | ],
689 | [
690 | {
691 | "Id": 30,
692 | "Alive": true,
693 | "X": 0,
694 | "Y": 6,
695 | "Width": 1,
696 | "Height": 1,
697 | "Type": "Wall",
698 | "PlayerNumber": 0
699 | },
700 | null,
701 | null,
702 | null,
703 | null,
704 | null,
705 | null,
706 | null,
707 | null,
708 | null,
709 | null,
710 | null,
711 | null,
712 | null,
713 | null,
714 | null,
715 | null,
716 | null,
717 | {
718 | "Id": 31,
719 | "Alive": true,
720 | "X": 18,
721 | "Y": 6,
722 | "Width": 1,
723 | "Height": 1,
724 | "Type": "Wall",
725 | "PlayerNumber": 0
726 | }
727 | ],
728 | [
729 | {
730 | "Id": 32,
731 | "Alive": true,
732 | "X": 0,
733 | "Y": 7,
734 | "Width": 1,
735 | "Height": 1,
736 | "Type": "Wall",
737 | "PlayerNumber": 0
738 | },
739 | null,
740 | null,
741 | null,
742 | null,
743 | null,
744 | null,
745 | null,
746 | null,
747 | null,
748 | null,
749 | null,
750 | null,
751 | null,
752 | null,
753 | null,
754 | null,
755 | null,
756 | {
757 | "Id": 33,
758 | "Alive": true,
759 | "X": 18,
760 | "Y": 7,
761 | "Width": 1,
762 | "Height": 1,
763 | "Type": "Wall",
764 | "PlayerNumber": 0
765 | }
766 | ],
767 | [
768 | {
769 | "Id": 34,
770 | "Alive": true,
771 | "X": 0,
772 | "Y": 8,
773 | "Width": 1,
774 | "Height": 1,
775 | "Type": "Wall",
776 | "PlayerNumber": 0
777 | },
778 | null,
779 | null,
780 | null,
781 | null,
782 | null,
783 | null,
784 | null,
785 | null,
786 | null,
787 | {
788 | "Id": 124,
789 | "Alive": true,
790 | "X": 10,
791 | "Y": 8,
792 | "Width": 1,
793 | "Height": 1,
794 | "Type": "Alien",
795 | "PlayerNumber": 1
796 | },
797 | null,
798 | null,
799 | {
800 | "Id": 123,
801 | "Alive": true,
802 | "X": 13,
803 | "Y": 8,
804 | "Width": 1,
805 | "Height": 1,
806 | "Type": "Alien",
807 | "PlayerNumber": 1
808 | },
809 | null,
810 | null,
811 | null,
812 | null,
813 | {
814 | "Id": 35,
815 | "Alive": true,
816 | "X": 18,
817 | "Y": 8,
818 | "Width": 1,
819 | "Height": 1,
820 | "Type": "Wall",
821 | "PlayerNumber": 0
822 | }
823 | ],
824 | [
825 | {
826 | "Id": 36,
827 | "Alive": true,
828 | "X": 0,
829 | "Y": 9,
830 | "Width": 1,
831 | "Height": 1,
832 | "Type": "Wall",
833 | "PlayerNumber": 0
834 | },
835 | null,
836 | null,
837 | null,
838 | null,
839 | null,
840 | null,
841 | {
842 | "Id": 176,
843 | "Alive": true,
844 | "X": 7,
845 | "Y": 9,
846 | "Width": 1,
847 | "Height": 1,
848 | "Type": "Missile",
849 | "PlayerNumber": 2
850 | },
851 | null,
852 | null,
853 | null,
854 | null,
855 | null,
856 | null,
857 | null,
858 | null,
859 | null,
860 | null,
861 | {
862 | "Id": 37,
863 | "Alive": true,
864 | "X": 18,
865 | "Y": 9,
866 | "Width": 1,
867 | "Height": 1,
868 | "Type": "Wall",
869 | "PlayerNumber": 0
870 | }
871 | ],
872 | [
873 | {
874 | "Id": 38,
875 | "Alive": true,
876 | "X": 0,
877 | "Y": 10,
878 | "Width": 1,
879 | "Height": 1,
880 | "Type": "Wall",
881 | "PlayerNumber": 0
882 | },
883 | null,
884 | null,
885 | null,
886 | {
887 | "Id": 168,
888 | "Alive": true,
889 | "X": 4,
890 | "Y": 10,
891 | "Width": 1,
892 | "Height": 1,
893 | "Type": "Alien",
894 | "PlayerNumber": 1
895 | },
896 | null,
897 | null,
898 | {
899 | "Id": 167,
900 | "Alive": true,
901 | "X": 7,
902 | "Y": 10,
903 | "Width": 1,
904 | "Height": 1,
905 | "Type": "Alien",
906 | "PlayerNumber": 1
907 | },
908 | null,
909 | null,
910 | {
911 | "Id": 166,
912 | "Alive": true,
913 | "X": 10,
914 | "Y": 10,
915 | "Width": 1,
916 | "Height": 1,
917 | "Type": "Alien",
918 | "PlayerNumber": 1
919 | },
920 | null,
921 | null,
922 | {
923 | "Id": 165,
924 | "Alive": true,
925 | "X": 13,
926 | "Y": 10,
927 | "Width": 1,
928 | "Height": 1,
929 | "Type": "Alien",
930 | "PlayerNumber": 1
931 | },
932 | null,
933 | null,
934 | null,
935 | null,
936 | {
937 | "Id": 39,
938 | "Alive": true,
939 | "X": 18,
940 | "Y": 10,
941 | "Width": 1,
942 | "Height": 1,
943 | "Type": "Wall",
944 | "PlayerNumber": 0
945 | }
946 | ],
947 | [
948 | {
949 | "Id": 40,
950 | "Alive": true,
951 | "X": 0,
952 | "Y": 11,
953 | "Width": 1,
954 | "Height": 1,
955 | "Type": "Wall",
956 | "PlayerNumber": 0
957 | },
958 | null,
959 | null,
960 | null,
961 | null,
962 | null,
963 | null,
964 | null,
965 | null,
966 | null,
967 | null,
968 | null,
969 | null,
970 | null,
971 | null,
972 | null,
973 | null,
974 | null,
975 | {
976 | "Id": 41,
977 | "Alive": true,
978 | "X": 18,
979 | "Y": 11,
980 | "Width": 1,
981 | "Height": 1,
982 | "Type": "Wall",
983 | "PlayerNumber": 0
984 | }
985 | ],
986 | [
987 | {
988 | "Id": 42,
989 | "Alive": true,
990 | "X": 0,
991 | "Y": 12,
992 | "Width": 1,
993 | "Height": 1,
994 | "Type": "Wall",
995 | "PlayerNumber": 0
996 | },
997 | null,
998 | null,
999 | null,
1000 | null,
1001 | null,
1002 | null,
1003 | null,
1004 | null,
1005 | null,
1006 | null,
1007 | null,
1008 | null,
1009 | null,
1010 | null,
1011 | null,
1012 | null,
1013 | null,
1014 | {
1015 | "Id": 43,
1016 | "Alive": true,
1017 | "X": 18,
1018 | "Y": 12,
1019 | "Width": 1,
1020 | "Height": 1,
1021 | "Type": "Wall",
1022 | "PlayerNumber": 0
1023 | }
1024 | ],
1025 | [
1026 | {
1027 | "Id": 44,
1028 | "Alive": true,
1029 | "X": 0,
1030 | "Y": 13,
1031 | "Width": 1,
1032 | "Height": 1,
1033 | "Type": "Wall",
1034 | "PlayerNumber": 0
1035 | },
1036 | null,
1037 | null,
1038 | {
1039 | "Id": 174,
1040 | "Alive": true,
1041 | "X": 3,
1042 | "Y": 13,
1043 | "Width": 1,
1044 | "Height": 1,
1045 | "Type": "Alien",
1046 | "PlayerNumber": 2
1047 | },
1048 | null,
1049 | null,
1050 | {
1051 | "Id": 173,
1052 | "Alive": true,
1053 | "X": 6,
1054 | "Y": 13,
1055 | "Width": 1,
1056 | "Height": 1,
1057 | "Type": "Alien",
1058 | "PlayerNumber": 2
1059 | },
1060 | null,
1061 | null,
1062 | {
1063 | "Id": 172,
1064 | "Alive": true,
1065 | "X": 9,
1066 | "Y": 13,
1067 | "Width": 1,
1068 | "Height": 1,
1069 | "Type": "Alien",
1070 | "PlayerNumber": 2
1071 | },
1072 | null,
1073 | null,
1074 | null,
1075 | null,
1076 | null,
1077 | null,
1078 | null,
1079 | null,
1080 | {
1081 | "Id": 45,
1082 | "Alive": true,
1083 | "X": 18,
1084 | "Y": 13,
1085 | "Width": 1,
1086 | "Height": 1,
1087 | "Type": "Wall",
1088 | "PlayerNumber": 0
1089 | }
1090 | ],
1091 | [
1092 | {
1093 | "Id": 46,
1094 | "Alive": true,
1095 | "X": 0,
1096 | "Y": 14,
1097 | "Width": 1,
1098 | "Height": 1,
1099 | "Type": "Wall",
1100 | "PlayerNumber": 0
1101 | },
1102 | null,
1103 | null,
1104 | null,
1105 | null,
1106 | null,
1107 | null,
1108 | null,
1109 | null,
1110 | null,
1111 | null,
1112 | null,
1113 | null,
1114 | null,
1115 | null,
1116 | null,
1117 | null,
1118 | null,
1119 | {
1120 | "Id": 47,
1121 | "Alive": true,
1122 | "X": 18,
1123 | "Y": 14,
1124 | "Width": 1,
1125 | "Height": 1,
1126 | "Type": "Wall",
1127 | "PlayerNumber": 0
1128 | }
1129 | ],
1130 | [
1131 | {
1132 | "Id": 48,
1133 | "Alive": true,
1134 | "X": 0,
1135 | "Y": 15,
1136 | "Width": 1,
1137 | "Height": 1,
1138 | "Type": "Wall",
1139 | "PlayerNumber": 0
1140 | },
1141 | null,
1142 | null,
1143 | null,
1144 | null,
1145 | null,
1146 | {
1147 | "Id": 128,
1148 | "Alive": true,
1149 | "X": 6,
1150 | "Y": 15,
1151 | "Width": 1,
1152 | "Height": 1,
1153 | "Type": "Alien",
1154 | "PlayerNumber": 2
1155 | },
1156 | null,
1157 | null,
1158 | {
1159 | "Id": 127,
1160 | "Alive": true,
1161 | "X": 9,
1162 | "Y": 15,
1163 | "Width": 1,
1164 | "Height": 1,
1165 | "Type": "Alien",
1166 | "PlayerNumber": 2
1167 | },
1168 | null,
1169 | null,
1170 | null,
1171 | null,
1172 | null,
1173 | null,
1174 | null,
1175 | null,
1176 | {
1177 | "Id": 49,
1178 | "Alive": true,
1179 | "X": 18,
1180 | "Y": 15,
1181 | "Width": 1,
1182 | "Height": 1,
1183 | "Type": "Wall",
1184 | "PlayerNumber": 0
1185 | }
1186 | ],
1187 | [
1188 | {
1189 | "Id": 50,
1190 | "Alive": true,
1191 | "X": 0,
1192 | "Y": 16,
1193 | "Width": 1,
1194 | "Height": 1,
1195 | "Type": "Wall",
1196 | "PlayerNumber": 0
1197 | },
1198 | null,
1199 | null,
1200 | null,
1201 | null,
1202 | null,
1203 | null,
1204 | null,
1205 | null,
1206 | null,
1207 | null,
1208 | {
1209 | "Id": 177,
1210 | "Alive": true,
1211 | "X": 11,
1212 | "Y": 16,
1213 | "Width": 1,
1214 | "Height": 1,
1215 | "Type": "Missile",
1216 | "PlayerNumber": 1
1217 | },
1218 | null,
1219 | null,
1220 | null,
1221 | null,
1222 | null,
1223 | null,
1224 | {
1225 | "Id": 51,
1226 | "Alive": true,
1227 | "X": 18,
1228 | "Y": 16,
1229 | "Width": 1,
1230 | "Height": 1,
1231 | "Type": "Wall",
1232 | "PlayerNumber": 0
1233 | }
1234 | ],
1235 | [
1236 | {
1237 | "Id": 52,
1238 | "Alive": true,
1239 | "X": 0,
1240 | "Y": 17,
1241 | "Width": 1,
1242 | "Height": 1,
1243 | "Type": "Wall",
1244 | "PlayerNumber": 0
1245 | },
1246 | null,
1247 | null,
1248 | null,
1249 | null,
1250 | null,
1251 | null,
1252 | null,
1253 | null,
1254 | null,
1255 | null,
1256 | null,
1257 | null,
1258 | null,
1259 | null,
1260 | null,
1261 | null,
1262 | null,
1263 | {
1264 | "Id": 53,
1265 | "Alive": true,
1266 | "X": 18,
1267 | "Y": 17,
1268 | "Width": 1,
1269 | "Height": 1,
1270 | "Type": "Wall",
1271 | "PlayerNumber": 0
1272 | }
1273 | ],
1274 | [
1275 | {
1276 | "Id": 54,
1277 | "Alive": true,
1278 | "X": 0,
1279 | "Y": 18,
1280 | "Width": 1,
1281 | "Height": 1,
1282 | "Type": "Wall",
1283 | "PlayerNumber": 0
1284 | },
1285 | null,
1286 | null,
1287 | null,
1288 | null,
1289 | null,
1290 | null,
1291 | null,
1292 | null,
1293 | null,
1294 | null,
1295 | null,
1296 | null,
1297 | null,
1298 | null,
1299 | null,
1300 | null,
1301 | null,
1302 | {
1303 | "Id": 55,
1304 | "Alive": true,
1305 | "X": 18,
1306 | "Y": 18,
1307 | "Width": 1,
1308 | "Height": 1,
1309 | "Type": "Wall",
1310 | "PlayerNumber": 0
1311 | }
1312 | ],
1313 | [
1314 | {
1315 | "Id": 56,
1316 | "Alive": true,
1317 | "X": 0,
1318 | "Y": 19,
1319 | "Width": 1,
1320 | "Height": 1,
1321 | "Type": "Wall",
1322 | "PlayerNumber": 0
1323 | },
1324 | null,
1325 | null,
1326 | {
1327 | "Id": 92,
1328 | "Alive": true,
1329 | "X": 3,
1330 | "Y": 19,
1331 | "Width": 1,
1332 | "Height": 1,
1333 | "Type": "Shield",
1334 | "PlayerNumber": 1
1335 | },
1336 | {
1337 | "Id": 95,
1338 | "Alive": true,
1339 | "X": 4,
1340 | "Y": 19,
1341 | "Width": 1,
1342 | "Height": 1,
1343 | "Type": "Shield",
1344 | "PlayerNumber": 1
1345 | },
1346 | null,
1347 | null,
1348 | {
1349 | "Id": 145,
1350 | "Alive": true,
1351 | "X": 7,
1352 | "Y": 19,
1353 | "Width": 1,
1354 | "Height": 1,
1355 | "Type": "Shield",
1356 | "PlayerNumber": 1
1357 | },
1358 | null,
1359 | null,
1360 | {
1361 | "Id": 156,
1362 | "Alive": true,
1363 | "X": 10,
1364 | "Y": 19,
1365 | "Width": 1,
1366 | "Height": 1,
1367 | "Type": "Shield",
1368 | "PlayerNumber": 1
1369 | },
1370 | null,
1371 | null,
1372 | null,
1373 | {
1374 | "Id": 98,
1375 | "Alive": true,
1376 | "X": 14,
1377 | "Y": 19,
1378 | "Width": 1,
1379 | "Height": 1,
1380 | "Type": "Shield",
1381 | "PlayerNumber": 1
1382 | },
1383 | {
1384 | "Id": 101,
1385 | "Alive": true,
1386 | "X": 15,
1387 | "Y": 19,
1388 | "Width": 1,
1389 | "Height": 1,
1390 | "Type": "Shield",
1391 | "PlayerNumber": 1
1392 | },
1393 | {
1394 | "Id": 104,
1395 | "Alive": true,
1396 | "X": 16,
1397 | "Y": 19,
1398 | "Width": 1,
1399 | "Height": 1,
1400 | "Type": "Shield",
1401 | "PlayerNumber": 1
1402 | },
1403 | null,
1404 | {
1405 | "Id": 57,
1406 | "Alive": true,
1407 | "X": 18,
1408 | "Y": 19,
1409 | "Width": 1,
1410 | "Height": 1,
1411 | "Type": "Wall",
1412 | "PlayerNumber": 0
1413 | }
1414 | ],
1415 | [
1416 | {
1417 | "Id": 58,
1418 | "Alive": true,
1419 | "X": 0,
1420 | "Y": 20,
1421 | "Width": 1,
1422 | "Height": 1,
1423 | "Type": "Wall",
1424 | "PlayerNumber": 0
1425 | },
1426 | null,
1427 | {
1428 | "Id": 88,
1429 | "Alive": true,
1430 | "X": 2,
1431 | "Y": 20,
1432 | "Width": 1,
1433 | "Height": 1,
1434 | "Type": "Shield",
1435 | "PlayerNumber": 1
1436 | },
1437 | {
1438 | "Id": 91,
1439 | "Alive": true,
1440 | "X": 3,
1441 | "Y": 20,
1442 | "Width": 1,
1443 | "Height": 1,
1444 | "Type": "Shield",
1445 | "PlayerNumber": 1
1446 | },
1447 | {
1448 | "Id": 94,
1449 | "Alive": true,
1450 | "X": 4,
1451 | "Y": 20,
1452 | "Width": 1,
1453 | "Height": 1,
1454 | "Type": "Shield",
1455 | "PlayerNumber": 1
1456 | },
1457 | null,
1458 | null,
1459 | {
1460 | "Id": 144,
1461 | "Alive": true,
1462 | "X": 7,
1463 | "Y": 20,
1464 | "Width": 1,
1465 | "Height": 1,
1466 | "Type": "Shield",
1467 | "PlayerNumber": 1
1468 | },
1469 | null,
1470 | {
1471 | "Id": 150,
1472 | "Alive": true,
1473 | "X": 9,
1474 | "Y": 20,
1475 | "Width": 1,
1476 | "Height": 1,
1477 | "Type": "Shield",
1478 | "PlayerNumber": 1
1479 | },
1480 | {
1481 | "Id": 155,
1482 | "Alive": true,
1483 | "X": 10,
1484 | "Y": 20,
1485 | "Width": 1,
1486 | "Height": 1,
1487 | "Type": "Shield",
1488 | "PlayerNumber": 1
1489 | },
1490 | null,
1491 | null,
1492 | null,
1493 | {
1494 | "Id": 97,
1495 | "Alive": true,
1496 | "X": 14,
1497 | "Y": 20,
1498 | "Width": 1,
1499 | "Height": 1,
1500 | "Type": "Shield",
1501 | "PlayerNumber": 1
1502 | },
1503 | {
1504 | "Id": 100,
1505 | "Alive": true,
1506 | "X": 15,
1507 | "Y": 20,
1508 | "Width": 1,
1509 | "Height": 1,
1510 | "Type": "Shield",
1511 | "PlayerNumber": 1
1512 | },
1513 | {
1514 | "Id": 103,
1515 | "Alive": true,
1516 | "X": 16,
1517 | "Y": 20,
1518 | "Width": 1,
1519 | "Height": 1,
1520 | "Type": "Shield",
1521 | "PlayerNumber": 1
1522 | },
1523 | null,
1524 | {
1525 | "Id": 59,
1526 | "Alive": true,
1527 | "X": 18,
1528 | "Y": 20,
1529 | "Width": 1,
1530 | "Height": 1,
1531 | "Type": "Wall",
1532 | "PlayerNumber": 0
1533 | }
1534 | ],
1535 | [
1536 | {
1537 | "Id": 60,
1538 | "Alive": true,
1539 | "X": 0,
1540 | "Y": 21,
1541 | "Width": 1,
1542 | "Height": 1,
1543 | "Type": "Wall",
1544 | "PlayerNumber": 0
1545 | },
1546 | null,
1547 | {
1548 | "Id": 87,
1549 | "Alive": true,
1550 | "X": 2,
1551 | "Y": 21,
1552 | "Width": 1,
1553 | "Height": 1,
1554 | "Type": "Shield",
1555 | "PlayerNumber": 1
1556 | },
1557 | {
1558 | "Id": 90,
1559 | "Alive": true,
1560 | "X": 3,
1561 | "Y": 21,
1562 | "Width": 1,
1563 | "Height": 1,
1564 | "Type": "Shield",
1565 | "PlayerNumber": 1
1566 | },
1567 | {
1568 | "Id": 93,
1569 | "Alive": true,
1570 | "X": 4,
1571 | "Y": 21,
1572 | "Width": 1,
1573 | "Height": 1,
1574 | "Type": "Shield",
1575 | "PlayerNumber": 1
1576 | },
1577 | null,
1578 | null,
1579 | {
1580 | "Id": 143,
1581 | "Alive": true,
1582 | "X": 7,
1583 | "Y": 21,
1584 | "Width": 1,
1585 | "Height": 1,
1586 | "Type": "Shield",
1587 | "PlayerNumber": 1
1588 | },
1589 | {
1590 | "Id": 146,
1591 | "Alive": true,
1592 | "X": 8,
1593 | "Y": 21,
1594 | "Width": 1,
1595 | "Height": 1,
1596 | "Type": "Shield",
1597 | "PlayerNumber": 1
1598 | },
1599 | null,
1600 | null,
1601 | null,
1602 | null,
1603 | null,
1604 | {
1605 | "Id": 96,
1606 | "Alive": true,
1607 | "X": 14,
1608 | "Y": 21,
1609 | "Width": 1,
1610 | "Height": 1,
1611 | "Type": "Shield",
1612 | "PlayerNumber": 1
1613 | },
1614 | {
1615 | "Id": 99,
1616 | "Alive": true,
1617 | "X": 15,
1618 | "Y": 21,
1619 | "Width": 1,
1620 | "Height": 1,
1621 | "Type": "Shield",
1622 | "PlayerNumber": 1
1623 | },
1624 | {
1625 | "Id": 102,
1626 | "Alive": true,
1627 | "X": 16,
1628 | "Y": 21,
1629 | "Width": 1,
1630 | "Height": 1,
1631 | "Type": "Shield",
1632 | "PlayerNumber": 1
1633 | },
1634 | null,
1635 | {
1636 | "Id": 61,
1637 | "Alive": true,
1638 | "X": 18,
1639 | "Y": 21,
1640 | "Width": 1,
1641 | "Height": 1,
1642 | "Type": "Wall",
1643 | "PlayerNumber": 0
1644 | }
1645 | ],
1646 | [
1647 | {
1648 | "Id": 62,
1649 | "Alive": true,
1650 | "X": 0,
1651 | "Y": 22,
1652 | "Width": 1,
1653 | "Height": 1,
1654 | "Type": "Wall",
1655 | "PlayerNumber": 0
1656 | },
1657 | null,
1658 | null,
1659 | null,
1660 | null,
1661 | null,
1662 | null,
1663 | null,
1664 | null,
1665 | null,
1666 | null,
1667 | {
1668 | "Command": "Nothing",
1669 | "CommandFeedback": "Tried to build a building but didn't have enough lives.",
1670 | "Id": 85,
1671 | "Alive": true,
1672 | "X": 11,
1673 | "Y": 22,
1674 | "Width": 3,
1675 | "Height": 1,
1676 | "Type": "Ship",
1677 | "PlayerNumber": 1
1678 | },
1679 | {
1680 | "Command": "Nothing",
1681 | "CommandFeedback": "Tried to build a building but didn't have enough lives.",
1682 | "Id": 85,
1683 | "Alive": true,
1684 | "X": 11,
1685 | "Y": 22,
1686 | "Width": 3,
1687 | "Height": 1,
1688 | "Type": "Ship",
1689 | "PlayerNumber": 1
1690 | },
1691 | {
1692 | "Command": "Nothing",
1693 | "CommandFeedback": "Tried to build a building but didn't have enough lives.",
1694 | "Id": 85,
1695 | "Alive": true,
1696 | "X": 11,
1697 | "Y": 22,
1698 | "Width": 3,
1699 | "Height": 1,
1700 | "Type": "Ship",
1701 | "PlayerNumber": 1
1702 | },
1703 | null,
1704 | null,
1705 | null,
1706 | null,
1707 | {
1708 | "Id": 63,
1709 | "Alive": true,
1710 | "X": 18,
1711 | "Y": 22,
1712 | "Width": 1,
1713 | "Height": 1,
1714 | "Type": "Wall",
1715 | "PlayerNumber": 0
1716 | }
1717 | ],
1718 | [
1719 | {
1720 | "Id": 64,
1721 | "Alive": true,
1722 | "X": 0,
1723 | "Y": 23,
1724 | "Width": 1,
1725 | "Height": 1,
1726 | "Type": "Wall",
1727 | "PlayerNumber": 0
1728 | },
1729 | null,
1730 | null,
1731 | null,
1732 | null,
1733 | null,
1734 | null,
1735 | null,
1736 | {
1737 | "LivesCost": 1,
1738 | "Id": 130,
1739 | "Alive": true,
1740 | "X": 8,
1741 | "Y": 23,
1742 | "Width": 3,
1743 | "Height": 1,
1744 | "Type": "AlienFactory",
1745 | "PlayerNumber": 1
1746 | },
1747 | {
1748 | "LivesCost": 1,
1749 | "Id": 130,
1750 | "Alive": true,
1751 | "X": 8,
1752 | "Y": 23,
1753 | "Width": 3,
1754 | "Height": 1,
1755 | "Type": "AlienFactory",
1756 | "PlayerNumber": 1
1757 | },
1758 | {
1759 | "LivesCost": 1,
1760 | "Id": 130,
1761 | "Alive": true,
1762 | "X": 8,
1763 | "Y": 23,
1764 | "Width": 3,
1765 | "Height": 1,
1766 | "Type": "AlienFactory",
1767 | "PlayerNumber": 1
1768 | },
1769 | null,
1770 | null,
1771 | null,
1772 | null,
1773 | null,
1774 | null,
1775 | null,
1776 | {
1777 | "Id": 65,
1778 | "Alive": true,
1779 | "X": 18,
1780 | "Y": 23,
1781 | "Width": 1,
1782 | "Height": 1,
1783 | "Type": "Wall",
1784 | "PlayerNumber": 0
1785 | }
1786 | ],
1787 | [
1788 | {
1789 | "Id": 66,
1790 | "Alive": true,
1791 | "X": 0,
1792 | "Y": 24,
1793 | "Width": 1,
1794 | "Height": 1,
1795 | "Type": "Wall",
1796 | "PlayerNumber": 0
1797 | },
1798 | {
1799 | "Id": 67,
1800 | "Alive": true,
1801 | "X": 1,
1802 | "Y": 24,
1803 | "Width": 1,
1804 | "Height": 1,
1805 | "Type": "Wall",
1806 | "PlayerNumber": 0
1807 | },
1808 | {
1809 | "Id": 68,
1810 | "Alive": true,
1811 | "X": 2,
1812 | "Y": 24,
1813 | "Width": 1,
1814 | "Height": 1,
1815 | "Type": "Wall",
1816 | "PlayerNumber": 0
1817 | },
1818 | {
1819 | "Id": 69,
1820 | "Alive": true,
1821 | "X": 3,
1822 | "Y": 24,
1823 | "Width": 1,
1824 | "Height": 1,
1825 | "Type": "Wall",
1826 | "PlayerNumber": 0
1827 | },
1828 | {
1829 | "Id": 70,
1830 | "Alive": true,
1831 | "X": 4,
1832 | "Y": 24,
1833 | "Width": 1,
1834 | "Height": 1,
1835 | "Type": "Wall",
1836 | "PlayerNumber": 0
1837 | },
1838 | {
1839 | "Id": 71,
1840 | "Alive": true,
1841 | "X": 5,
1842 | "Y": 24,
1843 | "Width": 1,
1844 | "Height": 1,
1845 | "Type": "Wall",
1846 | "PlayerNumber": 0
1847 | },
1848 | {
1849 | "Id": 72,
1850 | "Alive": true,
1851 | "X": 6,
1852 | "Y": 24,
1853 | "Width": 1,
1854 | "Height": 1,
1855 | "Type": "Wall",
1856 | "PlayerNumber": 0
1857 | },
1858 | {
1859 | "Id": 73,
1860 | "Alive": true,
1861 | "X": 7,
1862 | "Y": 24,
1863 | "Width": 1,
1864 | "Height": 1,
1865 | "Type": "Wall",
1866 | "PlayerNumber": 0
1867 | },
1868 | {
1869 | "Id": 74,
1870 | "Alive": true,
1871 | "X": 8,
1872 | "Y": 24,
1873 | "Width": 1,
1874 | "Height": 1,
1875 | "Type": "Wall",
1876 | "PlayerNumber": 0
1877 | },
1878 | {
1879 | "Id": 75,
1880 | "Alive": true,
1881 | "X": 9,
1882 | "Y": 24,
1883 | "Width": 1,
1884 | "Height": 1,
1885 | "Type": "Wall",
1886 | "PlayerNumber": 0
1887 | },
1888 | {
1889 | "Id": 76,
1890 | "Alive": true,
1891 | "X": 10,
1892 | "Y": 24,
1893 | "Width": 1,
1894 | "Height": 1,
1895 | "Type": "Wall",
1896 | "PlayerNumber": 0
1897 | },
1898 | {
1899 | "Id": 77,
1900 | "Alive": true,
1901 | "X": 11,
1902 | "Y": 24,
1903 | "Width": 1,
1904 | "Height": 1,
1905 | "Type": "Wall",
1906 | "PlayerNumber": 0
1907 | },
1908 | {
1909 | "Id": 78,
1910 | "Alive": true,
1911 | "X": 12,
1912 | "Y": 24,
1913 | "Width": 1,
1914 | "Height": 1,
1915 | "Type": "Wall",
1916 | "PlayerNumber": 0
1917 | },
1918 | {
1919 | "Id": 79,
1920 | "Alive": true,
1921 | "X": 13,
1922 | "Y": 24,
1923 | "Width": 1,
1924 | "Height": 1,
1925 | "Type": "Wall",
1926 | "PlayerNumber": 0
1927 | },
1928 | {
1929 | "Id": 80,
1930 | "Alive": true,
1931 | "X": 14,
1932 | "Y": 24,
1933 | "Width": 1,
1934 | "Height": 1,
1935 | "Type": "Wall",
1936 | "PlayerNumber": 0
1937 | },
1938 | {
1939 | "Id": 81,
1940 | "Alive": true,
1941 | "X": 15,
1942 | "Y": 24,
1943 | "Width": 1,
1944 | "Height": 1,
1945 | "Type": "Wall",
1946 | "PlayerNumber": 0
1947 | },
1948 | {
1949 | "Id": 82,
1950 | "Alive": true,
1951 | "X": 16,
1952 | "Y": 24,
1953 | "Width": 1,
1954 | "Height": 1,
1955 | "Type": "Wall",
1956 | "PlayerNumber": 0
1957 | },
1958 | {
1959 | "Id": 83,
1960 | "Alive": true,
1961 | "X": 17,
1962 | "Y": 24,
1963 | "Width": 1,
1964 | "Height": 1,
1965 | "Type": "Wall",
1966 | "PlayerNumber": 0
1967 | },
1968 | {
1969 | "Id": 84,
1970 | "Alive": true,
1971 | "X": 18,
1972 | "Y": 24,
1973 | "Width": 1,
1974 | "Height": 1,
1975 | "Type": "Wall",
1976 | "PlayerNumber": 0
1977 | }
1978 | ]
1979 | ]
1980 | },
1981 | "Players": [
1982 | {
1983 | "PlayerNumberReal": 1,
1984 | "PlayerNumber": 1,
1985 | "PlayerName": "Node Sample Bot",
1986 | "Ship": {
1987 | "Command": "Nothing",
1988 | "CommandFeedback": "Tried to build a building but didn't have enough lives.",
1989 | "Id": 85,
1990 | "Alive": true,
1991 | "X": 11,
1992 | "Y": 22,
1993 | "Width": 3,
1994 | "Height": 1,
1995 | "Type": "Ship",
1996 | "PlayerNumber": 1
1997 | },
1998 | "Kills": 1,
1999 | "Lives": 0,
2000 | "RespawnTimer": -1,
2001 | "Missiles": [
2002 | {
2003 | "Id": 177,
2004 | "Alive": true,
2005 | "X": 11,
2006 | "Y": 16,
2007 | "Width": 1,
2008 | "Height": 1,
2009 | "Type": "Missile",
2010 | "PlayerNumber": 1
2011 | }
2012 | ],
2013 | "MissileLimit": 1,
2014 | "AlienWaveSize": 4,
2015 | "AlienFactory": {
2016 | "LivesCost": 1,
2017 | "Id": 130,
2018 | "Alive": true,
2019 | "X": 8,
2020 | "Y": 23,
2021 | "Width": 3,
2022 | "Height": 1,
2023 | "Type": "AlienFactory",
2024 | "PlayerNumber": 1
2025 | },
2026 | "MissileController": null,
2027 | "AlienManager": {
2028 | "PlayerNumber": 1,
2029 | "Disabled": false,
2030 | "Waves": [
2031 | [
2032 | {
2033 | "Id": 123,
2034 | "Alive": true,
2035 | "X": 13,
2036 | "Y": 8,
2037 | "Width": 1,
2038 | "Height": 1,
2039 | "Type": "Alien",
2040 | "PlayerNumber": 1
2041 | },
2042 | {
2043 | "Id": 124,
2044 | "Alive": true,
2045 | "X": 10,
2046 | "Y": 8,
2047 | "Width": 1,
2048 | "Height": 1,
2049 | "Type": "Alien",
2050 | "PlayerNumber": 1
2051 | },
2052 | {
2053 | "Id": 125,
2054 | "Alive": false,
2055 | "X": 6,
2056 | "Y": 8,
2057 | "Width": 1,
2058 | "Height": 1,
2059 | "Type": "Alien",
2060 | "PlayerNumber": 1
2061 | }
2062 | ],
2063 | [
2064 | {
2065 | "Id": 165,
2066 | "Alive": true,
2067 | "X": 13,
2068 | "Y": 10,
2069 | "Width": 1,
2070 | "Height": 1,
2071 | "Type": "Alien",
2072 | "PlayerNumber": 1
2073 | },
2074 | {
2075 | "Id": 166,
2076 | "Alive": true,
2077 | "X": 10,
2078 | "Y": 10,
2079 | "Width": 1,
2080 | "Height": 1,
2081 | "Type": "Alien",
2082 | "PlayerNumber": 1
2083 | },
2084 | {
2085 | "Id": 167,
2086 | "Alive": true,
2087 | "X": 7,
2088 | "Y": 10,
2089 | "Width": 1,
2090 | "Height": 1,
2091 | "Type": "Alien",
2092 | "PlayerNumber": 1
2093 | },
2094 | {
2095 | "Id": 168,
2096 | "Alive": true,
2097 | "X": 4,
2098 | "Y": 10,
2099 | "Width": 1,
2100 | "Height": 1,
2101 | "Type": "Alien",
2102 | "PlayerNumber": 1
2103 | }
2104 | ]
2105 | ],
2106 | "ShotEnergyCost": 6,
2107 | "ShotEnergy": 3,
2108 | "DeltaX": 1
2109 | }
2110 | },
2111 | {
2112 | "PlayerNumberReal": 2,
2113 | "PlayerNumber": 2,
2114 | "PlayerName": "C# Sample Bot",
2115 | "Ship": {
2116 | "Command": "Nothing",
2117 | "CommandFeedback": "Tried to build a building but didn't have enough lives.",
2118 | "Id": 86,
2119 | "Alive": true,
2120 | "X": 7,
2121 | "Y": 2,
2122 | "Width": 3,
2123 | "Height": 1,
2124 | "Type": "Ship",
2125 | "PlayerNumber": 2
2126 | },
2127 | "Kills": 1,
2128 | "Lives": 0,
2129 | "RespawnTimer": -1,
2130 | "Missiles": [
2131 | {
2132 | "Id": 176,
2133 | "Alive": true,
2134 | "X": 7,
2135 | "Y": 9,
2136 | "Width": 1,
2137 | "Height": 1,
2138 | "Type": "Missile",
2139 | "PlayerNumber": 2
2140 | }
2141 | ],
2142 | "MissileLimit": 2,
2143 | "AlienWaveSize": 3,
2144 | "AlienFactory": null,
2145 | "MissileController": {
2146 | "LivesCost": 1,
2147 | "Id": 140,
2148 | "Alive": true,
2149 | "X": 8,
2150 | "Y": 1,
2151 | "Width": 3,
2152 | "Height": 1,
2153 | "Type": "MissileController",
2154 | "PlayerNumber": 2
2155 | },
2156 | "AlienManager": {
2157 | "PlayerNumber": 2,
2158 | "Disabled": false,
2159 | "Waves": [
2160 | [
2161 | {
2162 | "Id": 127,
2163 | "Alive": true,
2164 | "X": 9,
2165 | "Y": 15,
2166 | "Width": 1,
2167 | "Height": 1,
2168 | "Type": "Alien",
2169 | "PlayerNumber": 2
2170 | },
2171 | {
2172 | "Id": 128,
2173 | "Alive": true,
2174 | "X": 6,
2175 | "Y": 15,
2176 | "Width": 1,
2177 | "Height": 1,
2178 | "Type": "Alien",
2179 | "PlayerNumber": 2
2180 | }
2181 | ],
2182 | [
2183 | {
2184 | "Id": 172,
2185 | "Alive": true,
2186 | "X": 9,
2187 | "Y": 13,
2188 | "Width": 1,
2189 | "Height": 1,
2190 | "Type": "Alien",
2191 | "PlayerNumber": 2
2192 | },
2193 | {
2194 | "Id": 173,
2195 | "Alive": true,
2196 | "X": 6,
2197 | "Y": 13,
2198 | "Width": 1,
2199 | "Height": 1,
2200 | "Type": "Alien",
2201 | "PlayerNumber": 2
2202 | },
2203 | {
2204 | "Id": 174,
2205 | "Alive": true,
2206 | "X": 3,
2207 | "Y": 13,
2208 | "Width": 1,
2209 | "Height": 1,
2210 | "Type": "Alien",
2211 | "PlayerNumber": 2
2212 | }
2213 | ]
2214 | ],
2215 | "ShotEnergyCost": 6,
2216 | "ShotEnergy": 3,
2217 | "DeltaX": -1
2218 | }
2219 | }
2220 | ],
2221 | "RoundNumber": 33,
2222 | "RoundLimit": 200
2223 | }
2224 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
3 | 4.0.0
4 | za.co.entelect.challenge
5 | BasicBot
6 | jar
7 | 1.0-SNAPSHOT
8 | basic-bot
9 | http://maven.apache.org
10 |
11 |
12 |
13 | junit
14 | junit
15 | 4.11
16 | test
17 |
18 |
19 |
20 | com.jayway.jsonpath
21 | json-path
22 | 2.0.0
23 |
24 |
25 |
26 | com.jayway.jsonpath
27 | json-path-assert
28 | 2.0.0
29 | test
30 |
31 |
32 |
33 | org.slf4j
34 | slf4j-log4j12
35 | 1.7.10
36 |
37 |
38 |
39 | com.fasterxml.jackson.core
40 | jackson-core
41 | 2.2.3
42 |
43 |
44 |
45 | com.fasterxml.jackson.core
46 | jackson-annotations
47 | 2.2.3
48 |
49 |
50 |
51 | com.fasterxml.jackson.core
52 | jackson-databind
53 | 2.2.3
54 |
55 |
56 |
57 | com.google.api-client
58 | google-api-client-gson
59 | 1.18.0-rc
60 |
61 |
62 |
63 |
64 |
65 |
66 | maven-compiler-plugin
67 |
68 | 1.7
69 | 1.7
70 |
71 |
72 |
73 | maven-assembly-plugin
74 |
75 |
76 |
77 | za.co.entelect.challenge.program.Main
78 |
79 |
80 |
81 | jar-with-dependencies
82 |
83 |
84 |
85 |
86 |
87 |
88 |
93 |
94 | ${project.basedir}/src/main/resources
95 | true
96 |
97 | *.properties
98 |
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/run.bat:
--------------------------------------------------------------------------------
1 | java -jar target/BasicBot-1.0-SNAPSHOT-jar-with-dependencies.jar %1
--------------------------------------------------------------------------------
/run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | java -jar target/BasicBot-1.0-SNAPSHOT-jar-with-dependencies.jar $1
4 |
--------------------------------------------------------------------------------
/src/main/java/za/co/entelect/challenge/bot/BasicBot.java:
--------------------------------------------------------------------------------
1 | package za.co.entelect.challenge.bot;
2 |
3 | import za.co.entelect.challenge.dto.GameState;
4 | import za.co.entelect.challenge.dto.Player;
5 | import za.co.entelect.challenge.dto.Settings;
6 | import za.co.entelect.challenge.dto.enums.ShipCommand;
7 | import za.co.entelect.challenge.dto.reader.BasicGameStateReader;
8 | import za.co.entelect.challenge.dto.reader.GameStateReader;
9 | import za.co.entelect.challenge.dto.reader.GsonGameStateReader;
10 | import za.co.entelect.challenge.dto.reader.JacksonGameStateReader;
11 | import za.co.entelect.challenge.utils.BotHelper;
12 | import za.co.entelect.challenge.utils.FileHelper;
13 | import za.co.entelect.challenge.utils.LogHelper;
14 |
15 | import java.io.File;
16 | import java.io.IOException;
17 | import java.util.List;
18 | import java.util.Random;
19 |
20 | public class BasicBot {
21 |
22 | private Settings settings = null;
23 |
24 | public BasicBot(Settings settings) {
25 | this.settings = settings;
26 | }
27 |
28 | private GameState gameState;
29 |
30 | public void execute() {
31 |
32 | //Choose how you want to access the JSON
33 | GameStateReader reader =
34 | new BasicGameStateReader();
35 | //new JacksonGameStateReader();
36 | //new GsonGameStateReader();
37 |
38 | gameState = loadGameState(reader);
39 |
40 | logMatchState();
41 |
42 | StringBuilder map = loadMap();
43 | LogHelper.logPartsOnDifferentLines("Map", map);
44 |
45 | String move = getRandomMove();
46 | saveMove(move);
47 | }
48 |
49 | private GameState loadGameState(GameStateReader reader) {
50 | GameState gameState = null;
51 |
52 | File jsonFile = FileHelper.getFile(settings.getDefaultOutputFolder(), settings.getStateFile());
53 |
54 | try {
55 | gameState = reader.read(jsonFile);
56 | } catch (Exception ioe) {
57 | LogHelper.log("Error reading state file: " + settings.getStateFile());
58 | ioe.printStackTrace();
59 | return null;
60 | }
61 |
62 | return gameState;
63 | }
64 |
65 | private void logMatchState() {
66 | LogHelper.log(LogHelper.PREFIX + "Game state:");
67 | LogHelper.log("\tRound: " + gameState.getRoundNumber());
68 |
69 | for (Player player : getPlayers()) {
70 | logPlayerState(player);
71 | }
72 | }
73 |
74 | public GameState getGameState() {
75 | return gameState;
76 | }
77 |
78 | public List getPlayers() {
79 | return gameState.getPlayers();
80 | }
81 |
82 | private void logPlayerState(Player player) {
83 | LogHelper.log("\tPlayer " + player.getPlayerNumberReal() + " Kills: " + player.getKills());
84 | LogHelper.log("\tPlayer " + player.getPlayerNumberReal() + " Lives: " + player.getLives());
85 | LogHelper.log("\tPlayer " + player.getPlayerNumberReal() + " Missiles: " + player.getMissiles().size() + "/" + player.getMissileLimit());
86 | }
87 |
88 | private StringBuilder loadMap() {
89 | try {
90 | return FileHelper.readFile(settings.getDefaultOutputFolder(), settings.getMapFile());
91 | } catch(IOException ioe) {
92 | LogHelper.log("Unable to read map file: " + settings.getMapFile());
93 | ioe.printStackTrace();
94 | return new StringBuilder();
95 | }
96 | }
97 |
98 | private String getRandomMove() {
99 | long seed = System.currentTimeMillis();
100 | Random random = new Random(seed);
101 | int move = Math.abs(random.nextInt() % ShipCommand.values().length);
102 | String translatedMove = BotHelper.translateMove(move);
103 | return translatedMove;
104 | }
105 |
106 | private void saveMove(String move) {
107 | try {
108 | FileHelper.writeFile(settings.getDefaultOutputFolder(), settings.getOutputFile(), move);
109 | LogHelper.log("Move", move);
110 | } catch (IOException ioe) {
111 | LogHelper.log("Unable to write move file: " + settings.getOutputFile());
112 | ioe.printStackTrace();
113 | }
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/src/main/java/za/co/entelect/challenge/dto/AlienManager.java:
--------------------------------------------------------------------------------
1 | package za.co.entelect.challenge.dto;
2 |
3 | import com.fasterxml.jackson.annotation.*;
4 | import com.google.gson.annotations.SerializedName;
5 |
6 | import javax.annotation.Generated;
7 |
8 | import java.util.ArrayList;
9 | import java.util.HashMap;
10 | import java.util.List;
11 | import java.util.Map;
12 |
13 | @JsonInclude(JsonInclude.Include.NON_NULL)
14 | @Generated("org.jsonschema2pojo")
15 | @JsonPropertyOrder({
16 | "PlayerNumber",
17 | "Disabled",
18 | "Waves",
19 | "ShotEnergyCost",
20 | "ShotEnergy",
21 | "DeltaX"
22 | })
23 | public class AlienManager {
24 |
25 | @JsonProperty("PlayerNumber")
26 | @SerializedName("PlayerNumber")
27 | private Integer playerNumber;
28 | @JsonProperty("Disabled")
29 | @SerializedName("Disabled")
30 | private Boolean disabled;
31 | @JsonProperty("Waves")
32 | @SerializedName("Waves")
33 | private List> waves = new ArrayList>();
34 | @JsonProperty("ShotEnergyCost")
35 | @SerializedName("ShotEnergyCost")
36 | private Integer shotEnergyCost;
37 | @JsonProperty("ShotEnergy")
38 | @SerializedName("ShotEnergy")
39 | private Integer shotEnergy;
40 | @JsonProperty("DeltaX")
41 | @SerializedName("DeltaX")
42 | private Integer deltaX;
43 | @JsonIgnore
44 | private Map additionalProperties = new HashMap();
45 |
46 | /**
47 | *
48 | * @return
49 | * The PlayerNumber
50 | */
51 | @JsonProperty("PlayerNumber")
52 | public Integer getPlayerNumber() {
53 | return playerNumber;
54 | }
55 |
56 | /**
57 | *
58 | * @param PlayerNumber
59 | * The PlayerNumber
60 | */
61 | @JsonProperty("PlayerNumber")
62 | public void setPlayerNumber(Integer playerNumber) {
63 | this.playerNumber = playerNumber;
64 | }
65 |
66 | /**
67 | *
68 | * @return
69 | * The Disabled
70 | */
71 | @JsonProperty("Disabled")
72 | public Boolean getDisabled() {
73 | return disabled;
74 | }
75 |
76 | /**
77 | *
78 | * @param Disabled
79 | * The Disabled
80 | */
81 | @JsonProperty("Disabled")
82 | public void setDisabled(Boolean disabled) {
83 | this.disabled = disabled;
84 | }
85 |
86 | /**
87 | *
88 | * @return
89 | * The Waves
90 | */
91 | @JsonProperty("Waves")
92 | public List> getWaves() {
93 | return waves;
94 | }
95 |
96 | /**
97 | *
98 | * @param Waves
99 | * The Waves
100 | */
101 | @JsonProperty("Waves")
102 | public void setWaves(List> waves) {
103 | this.waves = waves;
104 | }
105 |
106 | /**
107 | *
108 | * @return
109 | * The ShotEnergyCost
110 | */
111 | @JsonProperty("ShotEnergyCost")
112 | public Integer getShotEnergyCost() {
113 | return shotEnergyCost;
114 | }
115 |
116 | /**
117 | *
118 | * @param ShotEnergyCost
119 | * The ShotEnergyCost
120 | */
121 | @JsonProperty("ShotEnergyCost")
122 | public void setShotEnergyCost(Integer shotEnergyCost) {
123 | this.shotEnergyCost = shotEnergyCost;
124 | }
125 |
126 | /**
127 | *
128 | * @return
129 | * The ShotEnergy
130 | */
131 | @JsonProperty("ShotEnergy")
132 | public Integer getShotEnergy() {
133 | return shotEnergy;
134 | }
135 |
136 | /**
137 | *
138 | * @param ShotEnergy
139 | * The ShotEnergy
140 | */
141 | @JsonProperty("ShotEnergy")
142 | public void setShotEnergy(Integer shotEnergy) {
143 | this.shotEnergy = shotEnergy;
144 | }
145 |
146 | /**
147 | *
148 | * @return
149 | * The DeltaX
150 | */
151 | @JsonProperty("DeltaX")
152 | public Integer getDeltaX() {
153 | return deltaX;
154 | }
155 |
156 | /**
157 | *
158 | * @param DeltaX
159 | * The DeltaX
160 | */
161 | @JsonProperty("DeltaX")
162 | public void setDeltaX(Integer deltaX) {
163 | this.deltaX = deltaX;
164 | }
165 |
166 | @JsonAnyGetter
167 | public Map getAdditionalProperties() {
168 | return this.additionalProperties;
169 | }
170 |
171 | @JsonAnySetter
172 | public void setAdditionalProperty(String name, Object value) {
173 | this.additionalProperties.put(name, value);
174 | }
175 |
176 | }
177 |
--------------------------------------------------------------------------------
/src/main/java/za/co/entelect/challenge/dto/BuildingsAvailable.java:
--------------------------------------------------------------------------------
1 | package za.co.entelect.challenge.dto;
2 |
3 | import com.fasterxml.jackson.annotation.*;
4 | import com.google.gson.annotations.SerializedName;
5 |
6 | import javax.annotation.Generated;
7 |
8 | import java.util.HashMap;
9 |
10 | @JsonInclude(JsonInclude.Include.NON_NULL)
11 | @Generated("org.jsonschema2pojo")
12 | @JsonPropertyOrder({
13 | "Command",
14 | "Type",
15 | "Cost"
16 | })
17 | public class BuildingsAvailable {
18 |
19 | @JsonProperty("Command")
20 | @SerializedName("Command")
21 | private String command;
22 | @JsonProperty("Type")
23 | @SerializedName("Type")
24 | private String type;
25 | @JsonProperty("Cost")
26 | @SerializedName("Cost")
27 | private Integer cost;
28 | @JsonIgnore
29 | private java.util.Map additionalProperties = new HashMap();
30 |
31 | /**
32 | *
33 | * @return
34 | * The Command
35 | */
36 | @JsonProperty("Command")
37 | public String getCommand() {
38 | return command;
39 | }
40 |
41 | /**
42 | *
43 | * @param Command
44 | * The Command
45 | */
46 | @JsonProperty("Command")
47 | public void setCommand(String command) {
48 | this.command = command;
49 | }
50 |
51 | /**
52 | *
53 | * @return
54 | * The Type
55 | */
56 | @JsonProperty("Type")
57 | public String getType() {
58 | return type;
59 | }
60 |
61 | /**
62 | *
63 | * @param Type
64 | * The Type
65 | */
66 | @JsonProperty("Type")
67 | public void setType(String type) {
68 | this.type = type;
69 | }
70 |
71 | /**
72 | *
73 | * @return
74 | * The Cost
75 | */
76 | @JsonProperty("Cost")
77 | public Integer getCost() {
78 | return cost;
79 | }
80 |
81 | /**
82 | *
83 | * @param Cost
84 | * The Cost
85 | */
86 | @JsonProperty("Cost")
87 | public void setCost(Integer cost) {
88 | this.cost = cost;
89 | }
90 |
91 | @JsonAnyGetter
92 | public java.util.Map getAdditionalProperties() {
93 | return this.additionalProperties;
94 | }
95 |
96 | @JsonAnySetter
97 | public void setAdditionalProperty(String name, Object value) {
98 | this.additionalProperties.put(name, value);
99 | }
100 |
101 | }
102 |
--------------------------------------------------------------------------------
/src/main/java/za/co/entelect/challenge/dto/GameState.java:
--------------------------------------------------------------------------------
1 | package za.co.entelect.challenge.dto;
2 |
3 | import com.fasterxml.jackson.annotation.*;
4 | import com.google.gson.annotations.SerializedName;
5 |
6 | import javax.annotation.Generated;
7 |
8 | import java.util.ArrayList;
9 | import java.util.HashMap;
10 | import java.util.List;
11 |
12 | @JsonInclude(JsonInclude.Include.NON_NULL)
13 | @Generated("org.jsonschema2pojo")
14 | @JsonPropertyOrder({
15 | "BuildingsAvailable",
16 | "Map",
17 | "Players",
18 | "RoundNumber",
19 | "RoundLimit"
20 | })
21 | public class GameState {
22 |
23 | @JsonProperty("BuildingsAvailable")
24 | @SerializedName("BuildingsAvailable")
25 | private List buildingsAvailable = new ArrayList();
26 | @JsonProperty("Map")
27 | @SerializedName("Map")
28 | private Map map;
29 | @JsonProperty("Players")
30 | @SerializedName("Players")
31 | private List players = new ArrayList();
32 | @JsonProperty("RoundNumber")
33 | @SerializedName("RoundNumber")
34 | private Integer roundNumber;
35 | @JsonProperty("RoundLimit")
36 | @SerializedName("RoundLimit")
37 | private Integer roundLimit;
38 | @JsonIgnore
39 | private java.util.Map additionalProperties = new HashMap();
40 |
41 | /**
42 | *
43 | * @return
44 | * The BuildingsAvailable
45 | */
46 | @JsonProperty("BuildingsAvailable")
47 | public List getBuildingsAvailable() {
48 | return buildingsAvailable;
49 | }
50 |
51 | /**
52 | *
53 | * @param BuildingsAvailable
54 | * The BuildingsAvailable
55 | */
56 | @JsonProperty("BuildingsAvailable")
57 | public void setBuildingsAvailable(List buildingsAvailable) {
58 | this.buildingsAvailable = buildingsAvailable;
59 | }
60 |
61 | /**
62 | *
63 | * @return
64 | * The Map
65 | */
66 | @JsonProperty("Map")
67 | public Map getMap() {
68 | return map;
69 | }
70 |
71 | /**
72 | *
73 | * @param Map
74 | * The Map
75 | */
76 | @JsonProperty("Map")
77 | public void setMap(Map map) {
78 | this.map = map;
79 | }
80 |
81 | /**
82 | *
83 | * @return
84 | * The Players
85 | */
86 | @JsonProperty("Players")
87 | public List getPlayers() {
88 | return players;
89 | }
90 |
91 | /**
92 | *
93 | * @param Players
94 | * The Players
95 | */
96 | @JsonProperty("Players")
97 | public void setPlayers(List players) {
98 | this.players = players;
99 | }
100 |
101 | /**
102 | *
103 | * @return
104 | * The RoundNumber
105 | */
106 | @JsonProperty("RoundNumber")
107 | public Integer getRoundNumber() {
108 | return roundNumber;
109 | }
110 |
111 | /**
112 | *
113 | * @param RoundNumber
114 | * The RoundNumber
115 | */
116 | @JsonProperty("RoundNumber")
117 | public void setRoundNumber(Integer roundNumber) {
118 | this.roundNumber = roundNumber;
119 | }
120 |
121 | /**
122 | *
123 | * @return
124 | * The RoundLimit
125 | */
126 | @JsonProperty("RoundLimit")
127 | public Integer getRoundLimit() {
128 | return roundLimit;
129 | }
130 |
131 | /**
132 | *
133 | * @param RoundLimit
134 | * The RoundLimit
135 | */
136 | @JsonProperty("RoundLimit")
137 | public void setRoundLimit(Integer roundLimit) {
138 | this.roundLimit = roundLimit;
139 | }
140 |
141 | @JsonAnyGetter
142 | public java.util.Map getAdditionalProperties() {
143 | return this.additionalProperties;
144 | }
145 |
146 | @JsonAnySetter
147 | public void setAdditionalProperty(String name, Object value) {
148 | this.additionalProperties.put(name, value);
149 | }
150 |
151 | }
152 |
153 |
154 |
155 |
156 |
157 |
--------------------------------------------------------------------------------
/src/main/java/za/co/entelect/challenge/dto/Map.java:
--------------------------------------------------------------------------------
1 | package za.co.entelect.challenge.dto;
2 |
3 | import com.fasterxml.jackson.annotation.*;
4 | import com.google.gson.annotations.SerializedName;
5 |
6 | import javax.annotation.Generated;
7 |
8 | import java.util.ArrayList;
9 | import java.util.HashMap;
10 | import java.util.List;
11 |
12 | @JsonInclude(JsonInclude.Include.NON_NULL)
13 | @Generated("org.jsonschema2pojo")
14 | @JsonPropertyOrder({
15 | "Width",
16 | "Height",
17 | "Rows"
18 | })
19 | public class Map {
20 |
21 | @JsonProperty("Width")
22 | @SerializedName("Width")
23 | private Integer width;
24 | @JsonProperty("Height")
25 | @SerializedName("Height")
26 | private Integer height;
27 | @JsonProperty("Rows")
28 | @SerializedName("Rows")
29 | private List> rows = new ArrayList>();
30 | @JsonIgnore
31 | private java.util.Map additionalProperties = new HashMap();
32 |
33 | /**
34 | *
35 | * @return
36 | * The Width
37 | */
38 | @JsonProperty("Width")
39 | public Integer getWidth() {
40 | return width;
41 | }
42 |
43 | /**
44 | *
45 | * @param Width
46 | * The Width
47 | */
48 | @JsonProperty("Width")
49 | public void setWidth(Integer width) {
50 | this.width = width;
51 | }
52 |
53 | /**
54 | *
55 | * @return
56 | * The Height
57 | */
58 | @JsonProperty("Height")
59 | public Integer getHeight() {
60 | return height;
61 | }
62 |
63 | /**
64 | *
65 | * @param Height
66 | * The Height
67 | */
68 | @JsonProperty("Height")
69 | public void setHeight(Integer height) {
70 | this.height = height;
71 | }
72 |
73 | /**
74 | *
75 | * @return
76 | * The Rows
77 | */
78 | @JsonProperty("Rows")
79 | public List> getRows() {
80 | return rows;
81 | }
82 |
83 | /**
84 | *
85 | * @param Rows
86 | * The Rows
87 | */
88 | @JsonProperty("Rows")
89 | public void setRows(List> rows) {
90 | this.rows = rows;
91 | }
92 |
93 | @JsonAnyGetter
94 | public java.util.Map getAdditionalProperties() {
95 | return this.additionalProperties;
96 | }
97 |
98 | @JsonAnySetter
99 | public void setAdditionalProperty(String name, Object value) {
100 | this.additionalProperties.put(name, value);
101 | }
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/src/main/java/za/co/entelect/challenge/dto/Missile.java:
--------------------------------------------------------------------------------
1 | package za.co.entelect.challenge.dto;
2 |
3 | import za.co.entelect.challenge.dto.enums.EntityType;
4 |
5 | public class Missile {
6 |
7 | private Boolean alive;
8 | private Integer x;
9 | private Integer y;
10 | private Integer width;
11 | private Integer height;
12 |
13 | private EntityType type;
14 |
15 | private Integer playerNumber;
16 | private Integer actionRate;
17 |
18 | public Boolean isAlive() {
19 | return alive;
20 | }
21 |
22 | public void setAlive(Boolean alive) {
23 | this.alive = alive;
24 | }
25 |
26 | public Integer getX() {
27 | return x;
28 | }
29 |
30 | public void setX(Integer x) {
31 | this.x = x;
32 | }
33 |
34 | public Integer getY() {
35 | return y;
36 | }
37 |
38 | public void setY(Integer y) {
39 | this.y = y;
40 | }
41 |
42 | public Integer getWidth() {
43 | return width;
44 | }
45 |
46 | public void setWidth(Integer width) {
47 | this.width = width;
48 | }
49 |
50 | public Integer getHeight() {
51 | return height;
52 | }
53 |
54 | public void setHeight(Integer height) {
55 | this.height = height;
56 | }
57 |
58 | public EntityType getType() {
59 | return type;
60 | }
61 |
62 | public void setType(EntityType type) {
63 | this.type = type;
64 | }
65 |
66 | public Integer getPlayerNumber() {
67 | return playerNumber;
68 | }
69 |
70 | public void setPlayerNumber(Integer playerNumber) {
71 | this.playerNumber = playerNumber;
72 | }
73 |
74 | public Integer getActionRate() {
75 | return actionRate;
76 | }
77 |
78 | public void setActionRate(Integer actionRate) {
79 | this.actionRate = actionRate;
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/src/main/java/za/co/entelect/challenge/dto/Player.java:
--------------------------------------------------------------------------------
1 | package za.co.entelect.challenge.dto;
2 |
3 | import com.fasterxml.jackson.annotation.*;
4 | import com.google.gson.annotations.SerializedName;
5 |
6 | import javax.annotation.Generated;
7 |
8 | import java.util.ArrayList;
9 | import java.util.HashMap;
10 | import java.util.List;
11 |
12 | @JsonInclude(JsonInclude.Include.NON_NULL)
13 | @Generated("org.jsonschema2pojo")
14 | @JsonPropertyOrder({
15 | "PlayerNumberReal",
16 | "PlayerNumber",
17 | "PlayerName",
18 | "Ship",
19 | "Kills",
20 | "Lives",
21 | "RespawnTimer",
22 | "Missiles",
23 | "MissileLimit",
24 | "AlienWaveSize",
25 | "AlienFactory",
26 | "MissileController",
27 | "AlienManager"
28 | })
29 | public class Player {
30 |
31 | @JsonProperty("PlayerNumberReal")
32 | @SerializedName("PlayerNumberReal")
33 | private Integer playerNumberReal;
34 | @JsonProperty("PlayerNumber")
35 | @SerializedName("PlayerNumber")
36 | private Integer playerNumber;
37 | @JsonProperty("PlayerName")
38 | @SerializedName("PlayerName")
39 | private String playerName;
40 | @JsonProperty("Ship")
41 | @SerializedName("Ship")
42 | private Ship ship;
43 | @JsonProperty("Kills")
44 | @SerializedName("Kills")
45 | private Integer kills;
46 | @JsonProperty("Lives")
47 | @SerializedName("Lives")
48 | private Integer lives;
49 | @JsonProperty("RespawnTimer")
50 | @SerializedName("RespawnTimer")
51 | private Integer respawnTimer;
52 | @JsonProperty("Missiles")
53 | @SerializedName("Missiles")
54 | private List