diff options
author | pacien | 2018-02-01 15:47:44 +0100 |
---|---|---|
committer | pacien | 2018-02-01 15:47:44 +0100 |
commit | a1942c8cfebd7c850e2cc3ecf94aa6dd8039409f (patch) | |
tree | c7acf0fbb6a37725072ba210f622abab9fc17ee3 /src/docs | |
parent | 48902d6696e40cb100c86fa83b131b4b7a016f52 (diff) | |
download | wallj-a1942c8cfebd7c850e2cc3ecf94aa6dd8039409f.tar.gz |
Add stage controller and Updateable interface
Signed-off-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'src/docs')
-rw-r--r-- | src/docs/class.puml | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/docs/class.puml b/src/docs/class.puml index b404102..dfbf5f8 100644 --- a/src/docs/class.puml +++ b/src/docs/class.puml | |||
@@ -23,6 +23,11 @@ package viewer { | |||
23 | } | 23 | } |
24 | 24 | ||
25 | package context { | 25 | package context { |
26 | interface Updateable { | ||
27 | List<Event> update(Context) | ||
28 | static List<Event> updateAll(List<Updateable>, Context) | ||
29 | } | ||
30 | |||
26 | class Context { | 31 | class Context { |
27 | Context(Game,List<Event>,GraphicsContext) | 32 | Context(Game,List<Event>,GraphicsContext) |
28 | Game getGame() | 33 | Game getGame() |
@@ -52,7 +57,7 @@ package context { | |||
52 | GraphicsContext clearScreen() | 57 | GraphicsContext clearScreen() |
53 | } | 58 | } |
54 | 59 | ||
55 | class Game { | 60 | class Game implements Updateable { |
56 | Stage | 61 | Stage |
57 | final List<Controller> | 62 | final List<Controller> |
58 | int indexBoard | 63 | int indexBoard |
@@ -91,7 +96,6 @@ package event { | |||
91 | class ConfirmEvent implements InputEvent | 96 | class ConfirmEvent implements InputEvent |
92 | class GameOverEvent implements Event | 97 | class GameOverEvent implements Event |
93 | 98 | ||
94 | |||
95 | class ExplosionEvent implements GameEvent { | 99 | class ExplosionEvent implements GameEvent { |
96 | Block source | 100 | Block source |
97 | Body source | 101 | Body source |
@@ -161,7 +165,7 @@ package block { | |||
161 | Block build(BlockType, TileVec2) | 165 | Block build(BlockType, TileVec2) |
162 | } | 166 | } |
163 | 167 | ||
164 | abstract class Block { | 168 | abstract class Block implements Updateable { |
165 | BlockType | 169 | BlockType |
166 | List<Controller> | 170 | List<Controller> |
167 | Vec2 | 171 | Vec2 |
@@ -180,10 +184,11 @@ package block { | |||
180 | class GarbageBlock extends Block | 184 | class GarbageBlock extends Block |
181 | class RobotBlock extends Block | 185 | class RobotBlock extends Block |
182 | 186 | ||
183 | class Stage { | 187 | class Stage implements Updateable { |
184 | List<Block> | 188 | List<Block> |
185 | Board | 189 | Board |
186 | Stage(Board) | 190 | Stage(Board) |
191 | Board getBoard() | ||
187 | List<Block> getBlocks() | 192 | List<Block> getBlocks() |
188 | List<Event> update(Context) | 193 | List<Event> update(Context) |
189 | bool isCleared() | 194 | bool isCleared() |
@@ -191,9 +196,7 @@ package block { | |||
191 | } | 196 | } |
192 | 197 | ||
193 | package controller { | 198 | package controller { |
194 | interface Controller { | 199 | interface Controller extends Updateable |
195 | List<Event> update(Context) | ||
196 | } | ||
197 | 200 | ||
198 | abstract class BlockController implements Controller { | 201 | abstract class BlockController implements Controller { |
199 | Block | 202 | Block |