@startuml skinparam linetype ortho package utils { class PathFinder { static List findPath(Board, TileVec2, TileVec2) } } package viewer { class Viewer { Game void main(String[]) void eventLoop(ApplicationContext) void renderFrame(Graphics2D) } } package context { class Context { Context(Stage,List,GraphicsContext) final Stage final List final GraphicsContext } class GraphicsContext { final Graphics2D final ScreenInfo paintCircle(Color, Vec2, int) paintSquare(Color, Vec2, int) } class InputHandler { private ApplicationContext InputHandler(ApplicationContext) List getEvents() } class ScreenManager { private ApplicationContext ScreenManager(ApplicationContext) GraphicsContext clearScreen() } class Game { final GameController Stage Game(GameController,Stage,List) } } package event { interface Event class DropBombEvent implements Event { DropBombEvent(TileVec2) } class MoveRobotEvent implements Event { MoveRobotEvent(TileVec2) } class ConfirmEvent implements Event } package board { class Board { Board(width, height) BlockType getBlockTypeAt(TileVec2) BlockType setBlockTypeAt(TileVec2, BlockType) } class BoardParser { static Board parse(File) } class BoardValidator { static bool validate(Board) } class BoardConverter { static Board worldToBoard(List) static List boardToWorld(Board) } class TileVec2 { static final int TILE_DIM static TileVec2 fromVec2(Vec2) Vec2 TileVec2(col, row) Vec2 toPixelPos() } } package model { enum BlockType { FREE WALL TRASH GARBAGE ROBOT BOMB } class BlockFactory { Block build(BlockType, Vec2) } abstract class Block { List Block(Vec2) Vec2 getPosition() void setPosition(Vec2) void update(Context) } abstract class StaticBlock extends Block class WallBlock extends StaticBlock class TrashBlock extends StaticBlock class BombBlock extends StaticBlock class GarbageBlock extends Block class RobotBlock extends Block class Stage { StageController List Stage(Board) List getBlocks() void update(Context) bool isCleared() } } package controller { interface Controller { void update(Context) } abstract class BlockController implements Controller { Block Controller(Block) Block getBlock() void update(Context) } class BlockControllerFactory { BlockController build(Block) } class GameController implements Controller class StageController implements Controller abstract class PhysicsController extends BlockController abstract class DisplayController extends BlockController class WallPhysicsController extends PhysicsController class WallDisplayController extends DisplayController class TrashPhysicsController extends PhysicsController class TrashDisplayController extends DisplayController class GarbagePhysicsController extends PhysicsController class GarbageDisplayController extends DisplayController class RobotPhysicsController extends PhysicsController { List path } class RobotDisplayController extends DisplayController class BombPhysicsController extends PhysicsController class BombDisplayController extends DisplayController } RobotPhysicsController --> PathFinder RobotPhysicsController --> BoardConverter Stage --> BoardConverter PhysicsController --() JBox2D Zen5 ()-- Viewer viewer --> context viewer --> model context --> event model --> controller board --> model @enduml