From 0091983257c380097810d9c8989e4504917c2c5e Mon Sep 17 00:00:00 2001 From: pacien Date: Wed, 10 Jan 2018 19:37:16 +0100 Subject: Implement block and block controller stubs Signed-off-by: pacien --- .../java/wallj/controller/BlockController.java | 17 ++++- .../wallj/controller/BlockControllerFactory.java | 48 ++++++++++++++- .../wallj/controller/BombDisplayController.java | 17 ++++- .../wallj/controller/BombPhysicsController.java | 17 ++++- .../fr/umlv/java/wallj/controller/Controller.java | 5 +- .../java/wallj/controller/DisplayController.java | 7 +++ .../wallj/controller/GarbageDisplayController.java | 17 ++++- .../wallj/controller/GarbagePhysicsController.java | 17 ++++- .../java/wallj/controller/PhysicsController.java | 7 +++ .../wallj/controller/RobotDisplayController.java | 17 ++++- .../wallj/controller/RobotPhysicsController.java | 17 ++++- .../wallj/controller/TrashDisplayController.java | 17 ++++- .../wallj/controller/TrashPhysicsController.java | 17 ++++- .../wallj/controller/WallDisplayController.java | 17 ++++- .../wallj/controller/WallPhysicsController.java | 17 ++++- src/main/java/fr/umlv/java/wallj/model/Block.java | 72 +++++++++++++++++++++- .../fr/umlv/java/wallj/model/BlockFactory.java | 41 +++++++++++- .../java/fr/umlv/java/wallj/model/BlockType.java | 56 +++++++++++++++-- .../java/fr/umlv/java/wallj/model/BombBlock.java | 30 ++++++++- .../fr/umlv/java/wallj/model/GarbageBlock.java | 16 ++++- .../java/fr/umlv/java/wallj/model/RobotBlock.java | 16 ++++- .../java/fr/umlv/java/wallj/model/StaticBlock.java | 5 -- .../java/fr/umlv/java/wallj/model/TrashBlock.java | 18 +++++- .../java/fr/umlv/java/wallj/model/WallBlock.java | 18 +++++- 24 files changed, 489 insertions(+), 37 deletions(-) delete mode 100644 src/main/java/fr/umlv/java/wallj/model/StaticBlock.java (limited to 'src/main/java') diff --git a/src/main/java/fr/umlv/java/wallj/controller/BlockController.java b/src/main/java/fr/umlv/java/wallj/controller/BlockController.java index 7ab6aec..bafa74a 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/BlockController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/BlockController.java @@ -1,8 +1,21 @@ package fr.umlv.java.wallj.controller; import fr.umlv.java.wallj.context.Context; +import fr.umlv.java.wallj.event.Event; +import fr.umlv.java.wallj.model.Block; + +import java.util.List; +import java.util.Objects; + +public abstract class BlockController implements Controller { + + private final Block block; + + BlockController(Block block) { + this.block = Objects.requireNonNull(block); + } -public abstract class BlockController implements Controller{ //TODO Check UML to implement BlockController - public abstract void update(Context context); + public abstract List update(Context context); + } diff --git a/src/main/java/fr/umlv/java/wallj/controller/BlockControllerFactory.java b/src/main/java/fr/umlv/java/wallj/controller/BlockControllerFactory.java index c820315..89d45ca 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/BlockControllerFactory.java +++ b/src/main/java/fr/umlv/java/wallj/controller/BlockControllerFactory.java @@ -1,5 +1,49 @@ package fr.umlv.java.wallj.controller; -public class BlockControllerFactory { - //TODO +import fr.umlv.java.wallj.model.*; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** + * A block controller factory. + * "I am the man who arranges the blocks that descend upon me from up above..." + * + * @author Pacien TRAN-GIRARD + */ +public final class BlockControllerFactory { + + /** + * @implNote no Lists.of in JDK8 + */ + private static List listOf(BlockController... controllers) { + return Collections.unmodifiableList(Arrays.asList(controllers)); + } + + /** + * Builds the controllers for the given block. + * + * @param b block + * @return list of controllers + */ + public static List build(Block b) { + if (b instanceof WallBlock) + return listOf(new WallPhysicsController((WallBlock) b), new WallDisplayController((WallBlock) b)); + if (b instanceof TrashBlock) + return listOf(new TrashPhysicsController((TrashBlock) b), new TrashDisplayController((TrashBlock) b)); + if (b instanceof GarbageBlock) + return listOf(new GarbagePhysicsController((GarbageBlock) b), new GarbageDisplayController((GarbageBlock) b)); + if (b instanceof RobotBlock) + return listOf(new RobotPhysicsController((RobotBlock) b), new RobotDisplayController((RobotBlock) b)); + if (b instanceof BombBlock) + return listOf(new BombPhysicsController((BombBlock) b), new BombDisplayController((BombBlock) b)); + + return Collections.emptyList(); + } + + private BlockControllerFactory() { + // static class + } + } diff --git a/src/main/java/fr/umlv/java/wallj/controller/BombDisplayController.java b/src/main/java/fr/umlv/java/wallj/controller/BombDisplayController.java index 43452d9..3347b73 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/BombDisplayController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/BombDisplayController.java @@ -1,10 +1,25 @@ package fr.umlv.java.wallj.controller; import fr.umlv.java.wallj.context.Context; +import fr.umlv.java.wallj.event.Event; +import fr.umlv.java.wallj.model.BombBlock; + +import java.util.List; +import java.util.Objects; public class BombDisplayController extends DisplayController { + + private final BombBlock bomb; + + BombDisplayController(BombBlock bomb) { + super(bomb); + this.bomb = Objects.requireNonNull(bomb); + } + @Override - public void update(Context context) { + public List update(Context context) { //TODO + return null; } + } diff --git a/src/main/java/fr/umlv/java/wallj/controller/BombPhysicsController.java b/src/main/java/fr/umlv/java/wallj/controller/BombPhysicsController.java index 948dcfb..02f00a3 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/BombPhysicsController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/BombPhysicsController.java @@ -1,10 +1,25 @@ package fr.umlv.java.wallj.controller; import fr.umlv.java.wallj.context.Context; +import fr.umlv.java.wallj.event.Event; +import fr.umlv.java.wallj.model.BombBlock; + +import java.util.List; +import java.util.Objects; public class BombPhysicsController extends PhysicsController { + + private final BombBlock bomb; + + BombPhysicsController(BombBlock bomb) { + super(bomb); + this.bomb = Objects.requireNonNull(bomb); + } + @Override - public void update(Context context) { + public List update(Context context) { //TODO + return null; } + } diff --git a/src/main/java/fr/umlv/java/wallj/controller/Controller.java b/src/main/java/fr/umlv/java/wallj/controller/Controller.java index 91fe0c2..6a28d62 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/Controller.java +++ b/src/main/java/fr/umlv/java/wallj/controller/Controller.java @@ -1,7 +1,10 @@ package fr.umlv.java.wallj.controller; import fr.umlv.java.wallj.context.Context; +import fr.umlv.java.wallj.event.Event; + +import java.util.List; public interface Controller { - void update(Context context); + List update(Context context); } diff --git a/src/main/java/fr/umlv/java/wallj/controller/DisplayController.java b/src/main/java/fr/umlv/java/wallj/controller/DisplayController.java index b368ddf..4b31a1c 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/DisplayController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/DisplayController.java @@ -1,5 +1,12 @@ package fr.umlv.java.wallj.controller; +import fr.umlv.java.wallj.model.Block; + public abstract class DisplayController extends BlockController { + + DisplayController(Block block) { + super(block); + } + //TODO } diff --git a/src/main/java/fr/umlv/java/wallj/controller/GarbageDisplayController.java b/src/main/java/fr/umlv/java/wallj/controller/GarbageDisplayController.java index 6f4b5ee..3b16f45 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/GarbageDisplayController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/GarbageDisplayController.java @@ -1,10 +1,25 @@ package fr.umlv.java.wallj.controller; import fr.umlv.java.wallj.context.Context; +import fr.umlv.java.wallj.event.Event; +import fr.umlv.java.wallj.model.GarbageBlock; + +import java.util.List; +import java.util.Objects; public class GarbageDisplayController extends DisplayController { + + private final GarbageBlock garbage; + + GarbageDisplayController(GarbageBlock garbage) { + super(garbage); + this.garbage = Objects.requireNonNull(garbage); + } + @Override - public void update(Context context) { + public List update(Context context) { //TODO + return null; } + } diff --git a/src/main/java/fr/umlv/java/wallj/controller/GarbagePhysicsController.java b/src/main/java/fr/umlv/java/wallj/controller/GarbagePhysicsController.java index db6214c..672af19 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/GarbagePhysicsController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/GarbagePhysicsController.java @@ -1,10 +1,25 @@ package fr.umlv.java.wallj.controller; import fr.umlv.java.wallj.context.Context; +import fr.umlv.java.wallj.event.Event; +import fr.umlv.java.wallj.model.GarbageBlock; + +import java.util.List; +import java.util.Objects; public class GarbagePhysicsController extends PhysicsController { + + private final GarbageBlock garbage; + + GarbagePhysicsController(GarbageBlock garbage) { + super(garbage); + this.garbage = Objects.requireNonNull(garbage); + } + @Override - public void update(Context context) { + public List update(Context context) { //TODO + return null; } + } diff --git a/src/main/java/fr/umlv/java/wallj/controller/PhysicsController.java b/src/main/java/fr/umlv/java/wallj/controller/PhysicsController.java index 052a5bb..f32790a 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/PhysicsController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/PhysicsController.java @@ -1,5 +1,12 @@ package fr.umlv.java.wallj.controller; +import fr.umlv.java.wallj.model.Block; + public abstract class PhysicsController extends BlockController { + + PhysicsController(Block block) { + super(block); + } + //TODO } diff --git a/src/main/java/fr/umlv/java/wallj/controller/RobotDisplayController.java b/src/main/java/fr/umlv/java/wallj/controller/RobotDisplayController.java index a5fd599..a846152 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/RobotDisplayController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/RobotDisplayController.java @@ -1,10 +1,25 @@ package fr.umlv.java.wallj.controller; import fr.umlv.java.wallj.context.Context; +import fr.umlv.java.wallj.event.Event; +import fr.umlv.java.wallj.model.RobotBlock; + +import java.util.List; +import java.util.Objects; public class RobotDisplayController extends DisplayController { + + private final RobotBlock robot; + + RobotDisplayController(RobotBlock robot) { + super(robot); + this.robot = Objects.requireNonNull(robot); + } + @Override - public void update(Context context) { + public List update(Context context) { //TODO + return null; } + } diff --git a/src/main/java/fr/umlv/java/wallj/controller/RobotPhysicsController.java b/src/main/java/fr/umlv/java/wallj/controller/RobotPhysicsController.java index a10ded1..c863c7f 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/RobotPhysicsController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/RobotPhysicsController.java @@ -1,10 +1,25 @@ package fr.umlv.java.wallj.controller; import fr.umlv.java.wallj.context.Context; +import fr.umlv.java.wallj.event.Event; +import fr.umlv.java.wallj.model.RobotBlock; + +import java.util.List; +import java.util.Objects; public class RobotPhysicsController extends PhysicsController { + + private final RobotBlock robot; + + RobotPhysicsController(RobotBlock robot) { + super(robot); + this.robot = Objects.requireNonNull(robot); + } + @Override - public void update(Context context) { + public List update(Context context) { //TODO + return null; } + } diff --git a/src/main/java/fr/umlv/java/wallj/controller/TrashDisplayController.java b/src/main/java/fr/umlv/java/wallj/controller/TrashDisplayController.java index 78697cb..d981154 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/TrashDisplayController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/TrashDisplayController.java @@ -1,10 +1,25 @@ package fr.umlv.java.wallj.controller; import fr.umlv.java.wallj.context.Context; +import fr.umlv.java.wallj.event.Event; +import fr.umlv.java.wallj.model.TrashBlock; + +import java.util.List; +import java.util.Objects; public class TrashDisplayController extends DisplayController { + + private final TrashBlock trash; + + TrashDisplayController(TrashBlock trash) { + super(trash); + this.trash = Objects.requireNonNull(trash); + } + @Override - public void update(Context context) { + public List update(Context context) { //TODO + return null; } + } diff --git a/src/main/java/fr/umlv/java/wallj/controller/TrashPhysicsController.java b/src/main/java/fr/umlv/java/wallj/controller/TrashPhysicsController.java index 6ec10c7..117f5a2 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/TrashPhysicsController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/TrashPhysicsController.java @@ -1,10 +1,25 @@ package fr.umlv.java.wallj.controller; import fr.umlv.java.wallj.context.Context; +import fr.umlv.java.wallj.event.Event; +import fr.umlv.java.wallj.model.TrashBlock; + +import java.util.List; +import java.util.Objects; public class TrashPhysicsController extends PhysicsController { + + private final TrashBlock trash; + + TrashPhysicsController(TrashBlock trash) { + super(trash); + this.trash = Objects.requireNonNull(trash); + } + @Override - public void update(Context context) { + public List update(Context context) { //TODO + return null; } + } diff --git a/src/main/java/fr/umlv/java/wallj/controller/WallDisplayController.java b/src/main/java/fr/umlv/java/wallj/controller/WallDisplayController.java index 9c6dece..b0a41ed 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/WallDisplayController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/WallDisplayController.java @@ -1,10 +1,25 @@ package fr.umlv.java.wallj.controller; import fr.umlv.java.wallj.context.Context; +import fr.umlv.java.wallj.event.Event; +import fr.umlv.java.wallj.model.WallBlock; + +import java.util.List; +import java.util.Objects; public class WallDisplayController extends BlockController { + + private final WallBlock wall; + + WallDisplayController(WallBlock wall) { + super(wall); + this.wall = Objects.requireNonNull(wall); + } + @Override - public void update(Context context) { + public List update(Context context) { //TODO + return null; } + } diff --git a/src/main/java/fr/umlv/java/wallj/controller/WallPhysicsController.java b/src/main/java/fr/umlv/java/wallj/controller/WallPhysicsController.java index 0d01820..6131449 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/WallPhysicsController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/WallPhysicsController.java @@ -1,10 +1,25 @@ package fr.umlv.java.wallj.controller; import fr.umlv.java.wallj.context.Context; +import fr.umlv.java.wallj.event.Event; +import fr.umlv.java.wallj.model.WallBlock; + +import java.util.List; +import java.util.Objects; public class WallPhysicsController extends PhysicsController { + + private final WallBlock wall; + + WallPhysicsController(WallBlock wall) { + super(wall); + this.wall = Objects.requireNonNull(wall); + } + @Override - public void update(Context context) { + public List update(Context context) { //TODO + return null; } + } diff --git a/src/main/java/fr/umlv/java/wallj/model/Block.java b/src/main/java/fr/umlv/java/wallj/model/Block.java index 005ae5c..a929b8f 100644 --- a/src/main/java/fr/umlv/java/wallj/model/Block.java +++ b/src/main/java/fr/umlv/java/wallj/model/Block.java @@ -1,5 +1,75 @@ package fr.umlv.java.wallj.model; +import fr.umlv.java.wallj.board.TileVec2; +import fr.umlv.java.wallj.context.Context; +import fr.umlv.java.wallj.controller.BlockController; +import fr.umlv.java.wallj.controller.Controller; +import fr.umlv.java.wallj.event.Event; +import org.jbox2d.common.Vec2; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * A block. + * + * @author Pacien TRAN-GIRARD + */ public abstract class Block { - //TODO Class Block + + private final BlockType type; + private List controllers; + private Vec2 pos; + + /** + * @param type type of block + * @param pos initial position + */ + Block(BlockType type, Vec2 pos) { + this.type = Objects.requireNonNull(type); + this.pos = Objects.requireNonNull(pos).clone(); + } + + void setControllers(List l) { + controllers = Collections.unmodifiableList(new LinkedList<>(Objects.requireNonNull(l))); + } + + /** + * @param pos new position to set + */ + public void setPos(Vec2 pos) { + this.pos = Objects.requireNonNull(pos).clone(); + } + + /** + * @return the block type + */ + public BlockType getType() { + return type; + } + + /** + * @return the current position + */ + public Vec2 getPos() { + return pos.clone(); + } + + /** + * @return the current tile position + */ + public TileVec2 getTile() { + return TileVec2.of(pos); + } + + /** + * @param ctx execution context + * @return list of generated events + */ + public List update(Context ctx) { + return controllers.stream() + .flatMap(controller -> controller.update(ctx).stream()) + .collect(Collectors.toList()); + } + } diff --git a/src/main/java/fr/umlv/java/wallj/model/BlockFactory.java b/src/main/java/fr/umlv/java/wallj/model/BlockFactory.java index aacd4d3..12a0a94 100644 --- a/src/main/java/fr/umlv/java/wallj/model/BlockFactory.java +++ b/src/main/java/fr/umlv/java/wallj/model/BlockFactory.java @@ -1,5 +1,42 @@ package fr.umlv.java.wallj.model; -public class BlockFactory { - //TODO +import fr.umlv.java.wallj.board.TileVec2; +import fr.umlv.java.wallj.controller.BlockControllerFactory; +import org.jbox2d.common.Vec2; + +/** + * A block factory. + * + * @author Pacien TRAN-GIRARD + */ +public final class BlockFactory { + + private static Block forType(BlockType t, Vec2 pos) { + switch (t) { + case WALL: + return new WallBlock(pos); + case TRASH: + return new TrashBlock(pos); + case GARBAGE: + return new GarbageBlock(pos); + case ROBOT: + return new RobotBlock(pos); + case BOMB: + return new BombBlock(pos); + case FREE: + default: + return null; + } + } + + public static Block build(BlockType type, TileVec2 pos) { + Block block = forType(type, pos.toVec2()); + if (block != null) block.setControllers(BlockControllerFactory.build(block)); + return block; + } + + private BlockFactory() { + // static class + } + } diff --git a/src/main/java/fr/umlv/java/wallj/model/BlockType.java b/src/main/java/fr/umlv/java/wallj/model/BlockType.java index 64ef602..1334b52 100644 --- a/src/main/java/fr/umlv/java/wallj/model/BlockType.java +++ b/src/main/java/fr/umlv/java/wallj/model/BlockType.java @@ -2,12 +2,56 @@ package fr.umlv.java.wallj.model; /** * Enumeration of the types of blocks handled in the game. + * + * @author Pacien TRAN-GIRARD */ public enum BlockType { - FREE, - wALL, - TRASH, - GARBAGE, - ROBOT, - BOMB + + FREE(false, true, true, false), + WALL(true, false, false, false), + TRASH(true, true, false, false), + GARBAGE(false, true, true, true), + ROBOT(false, false, true, false), + BOMB(false, false, true, false); + + final boolean bounding; + final boolean mustBeReachable; + final boolean traversable; + final boolean movableByExplosion; + + BlockType(boolean bounding, boolean mustBeReachable, boolean traversable, boolean movableByExplosion) { + this.bounding = bounding; + this.mustBeReachable = mustBeReachable; + this.traversable = traversable; + this.movableByExplosion = movableByExplosion; + } + + /** + * @return this block can bound a map + */ + public boolean isBounding() { + return bounding; + } + + /** + * @return this block must be reachable + */ + public boolean mustBeReachable() { + return mustBeReachable; + } + + /** + * @return this block is traversable + */ + public boolean isTraversable() { + return traversable; + } + + /** + * @return this block can be moved by an explosion + */ + public boolean isMovableByExplosion() { + return movableByExplosion; + } + } diff --git a/src/main/java/fr/umlv/java/wallj/model/BombBlock.java b/src/main/java/fr/umlv/java/wallj/model/BombBlock.java index 183a630..8ee56ae 100644 --- a/src/main/java/fr/umlv/java/wallj/model/BombBlock.java +++ b/src/main/java/fr/umlv/java/wallj/model/BombBlock.java @@ -1,5 +1,31 @@ package fr.umlv.java.wallj.model; -public class BombBlock extends StaticBlock { - //TODO +import org.jbox2d.common.Vec2; + +/** + * A bomb block. + * + * @author Pacien TRAN-GIRARD + */ +public class BombBlock extends Block { + + private static final int INITIAL_TIMER = 1; // sec + + private int timer = INITIAL_TIMER; + + /** + * @param pos initial position + */ + public BombBlock(Vec2 pos) { + super(BlockType.BOMB, pos); + } + + public void setTimer(int sec) { + timer = sec; + } + + public int getTimer() { + return timer; + } + } diff --git a/src/main/java/fr/umlv/java/wallj/model/GarbageBlock.java b/src/main/java/fr/umlv/java/wallj/model/GarbageBlock.java index 1cb5bf6..7db62b1 100644 --- a/src/main/java/fr/umlv/java/wallj/model/GarbageBlock.java +++ b/src/main/java/fr/umlv/java/wallj/model/GarbageBlock.java @@ -1,5 +1,19 @@ package fr.umlv.java.wallj.model; +import org.jbox2d.common.Vec2; + +/** + * A garbage block. + * + * @author Pacien TRAN-GIRARD + */ public class GarbageBlock extends Block { - //TODO + + /** + * @param pos initial position + */ + public GarbageBlock(Vec2 pos) { + super(BlockType.GARBAGE, pos); + } + } diff --git a/src/main/java/fr/umlv/java/wallj/model/RobotBlock.java b/src/main/java/fr/umlv/java/wallj/model/RobotBlock.java index 08f6d5f..94ec384 100644 --- a/src/main/java/fr/umlv/java/wallj/model/RobotBlock.java +++ b/src/main/java/fr/umlv/java/wallj/model/RobotBlock.java @@ -1,5 +1,19 @@ package fr.umlv.java.wallj.model; +import org.jbox2d.common.Vec2; + +/** + * A robot block. + * + * @author Pacien TRAN-GIRARD + */ public class RobotBlock extends Block { - //TODO + + /** + * @param pos initial position + */ + public RobotBlock(Vec2 pos) { + super(BlockType.ROBOT, pos); + } + } diff --git a/src/main/java/fr/umlv/java/wallj/model/StaticBlock.java b/src/main/java/fr/umlv/java/wallj/model/StaticBlock.java deleted file mode 100644 index f015fad..0000000 --- a/src/main/java/fr/umlv/java/wallj/model/StaticBlock.java +++ /dev/null @@ -1,5 +0,0 @@ -package fr.umlv.java.wallj.model; - -public abstract class StaticBlock extends Block { - //TODO Class StaticBlock -} diff --git a/src/main/java/fr/umlv/java/wallj/model/TrashBlock.java b/src/main/java/fr/umlv/java/wallj/model/TrashBlock.java index 715a365..ec7a610 100644 --- a/src/main/java/fr/umlv/java/wallj/model/TrashBlock.java +++ b/src/main/java/fr/umlv/java/wallj/model/TrashBlock.java @@ -1,5 +1,19 @@ package fr.umlv.java.wallj.model; -public class TrashBlock extends StaticBlock{ - //TODO +import org.jbox2d.common.Vec2; + +/** + * A trash block. + * + * @author Pacien TRAN-GIRARD + */ +public class TrashBlock extends Block { + + /** + * @param pos initial position + */ + public TrashBlock(Vec2 pos) { + super(BlockType.TRASH, pos); + } + } diff --git a/src/main/java/fr/umlv/java/wallj/model/WallBlock.java b/src/main/java/fr/umlv/java/wallj/model/WallBlock.java index 63dc703..48be5c3 100644 --- a/src/main/java/fr/umlv/java/wallj/model/WallBlock.java +++ b/src/main/java/fr/umlv/java/wallj/model/WallBlock.java @@ -1,5 +1,19 @@ package fr.umlv.java.wallj.model; -public class WallBlock extends StaticBlock { - //TODO Class WallBlock +import org.jbox2d.common.Vec2; + +/** + * A wall block. + * + * @author Pacien TRAN-GIRARD + */ +public class WallBlock extends Block { + + /** + * @param pos initial position + */ + public WallBlock(Vec2 pos) { + super(BlockType.WALL, pos); + } + } -- cgit v1.2.3