diff options
author | Pacien TRAN-GIRARD | 2016-02-20 19:42:27 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2016-02-20 19:42:27 +0100 |
commit | 1c2fcab99adf3179df347ac352cfd5af1bd19014 (patch) | |
tree | 0b7231f71ef8a481587b3e95a6b29983aefd6f9d /test/ch/epfl | |
parent | df1880840db7bd8229d46118fb6d8508ecda61a1 (diff) | |
download | xblast-1c2fcab99adf3179df347ac352cfd5af1bd19014.tar.gz |
Import second part unit tests
Diffstat (limited to 'test/ch/epfl')
-rw-r--r-- | test/ch/epfl/xblast/namecheck/NameCheck02.java | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/test/ch/epfl/xblast/namecheck/NameCheck02.java b/test/ch/epfl/xblast/namecheck/NameCheck02.java new file mode 100644 index 0000000..978526e --- /dev/null +++ b/test/ch/epfl/xblast/namecheck/NameCheck02.java | |||
@@ -0,0 +1,60 @@ | |||
1 | package ch.epfl.xblast.namecheck; | ||
2 | |||
3 | import java.util.List; | ||
4 | |||
5 | import ch.epfl.cs108.Sq; | ||
6 | import ch.epfl.xblast.Cell; | ||
7 | import ch.epfl.xblast.Lists; | ||
8 | import ch.epfl.xblast.server.Block; | ||
9 | import ch.epfl.xblast.server.Board; | ||
10 | import ch.epfl.xblast.server.Ticks; | ||
11 | |||
12 | /** | ||
13 | * Classe abstraite utilisant tous les éléments de l'étape 2, pour essayer de | ||
14 | * garantir que ceux-ci ont le bon nom et les bons types. Attention, ceci n'est | ||
15 | * pas un test unitaire, et n'a pas pour but d'être exécuté! | ||
16 | */ | ||
17 | |||
18 | abstract class NameCheck02 { | ||
19 | void checkTicks() { | ||
20 | int x = Ticks.PLAYER_DYING_TICKS | ||
21 | + Ticks.PLAYER_INVULNERABLE_TICKS | ||
22 | + Ticks.BOMB_FUSE_TICKS | ||
23 | + Ticks.EXPLOSION_TICKS | ||
24 | + Ticks.WALL_CRUMBLING_TICKS | ||
25 | + Ticks.BONUS_DISAPPEARING_TICKS; | ||
26 | System.out.println(x); | ||
27 | } | ||
28 | |||
29 | void checkBlock() { | ||
30 | Block b = Block.FREE; | ||
31 | b = Block.INDESTRUCTIBLE_WALL; | ||
32 | b = Block.DESTRUCTIBLE_WALL; | ||
33 | b = Block.CRUMBLING_WALL; | ||
34 | boolean d = b.isFree() && b.canHostPlayer() && b.castsShadow(); | ||
35 | System.out.println(b + "/" + d); | ||
36 | } | ||
37 | |||
38 | void checkLists() { | ||
39 | List<Integer> l1 = null; | ||
40 | List<String> l2 = null; | ||
41 | List<List<String>> l3 = null; | ||
42 | List<Integer> l1m = Lists.<Integer>mirrored(l1); | ||
43 | List<String> l2m = Lists.<String>mirrored(l2); | ||
44 | List<List<String>> l3m = Lists.<List<String>>mirrored(l3); | ||
45 | System.out.println("" + l1m + l2m + l3m); | ||
46 | } | ||
47 | |||
48 | void checkBoard() { | ||
49 | List<List<Block>> q = null; | ||
50 | Board b = Board.ofQuadrantNWBlocksWalled(q); | ||
51 | b = Board.ofInnerBlocksWalled(q); | ||
52 | b = Board.ofRows(q); | ||
53 | List<Sq<Block>> cells = null; | ||
54 | b = new Board(cells); | ||
55 | Cell c = null; | ||
56 | Sq<Block> bs = b.blocksAt(c); | ||
57 | Block l = b.blockAt(c); | ||
58 | System.out.println(bs + "/" + l); | ||
59 | } | ||
60 | } | ||