BoardPiece |
-x:int -y:int |
+BoardPiece(int,int) +getX():int +getY():int +toString():String +manhattanDistance(BoardPiece,BoardPiece):int |
|
|
|
|
Board |
-rows:int -cols:int -board:BoardPiece[][] |
+Board(int,int) +getRows():int +getCols():int +getPiece(int,int):BoardPiece +addPiece(BoardPiece):void +isOnBoard(int,int):boolean +toString():String |
Game |
-gameBoard:Board -player:Player -boardWindow:Window |
+Game(Board) +setWindow(Window):void |
Note that methods that are given in an interface must be implemented in a class implementing that interface; however, methods that are given in the UML diagram for the interface are not repeated in the UML class diagram for the implementing class. In particular, because Game implements the KeyBoardListener interface, the Game class will have a takeKey(char) method and because Game implements the WindowPainter interface, the Game class will have a repaint() method. The UML class diagram for Game (above) does not list takeKey(char) or repaint(); those methods are listed in the UML diagrams for the appropriate interfaces.
|
|