1 | package jpacman.model; |
2 | |
3 | /** |
4 | * A monster on the board. |
5 | * |
6 | * @author Arie van Deursen; Jul 28, 2003 |
7 | * @version $Id: Monster.java,v 1.7 2008/02/07 08:40:42 arie Exp $ |
8 | */ |
9 | public class Monster extends MovingGuest { |
10 | |
11 | /** |
12 | * Create a new monster, not occupying a cell yet. |
13 | */ |
14 | public Monster() { |
15 | super(); |
16 | } |
17 | |
18 | /** |
19 | * The player decided to bumb into this monster. Modify the move's state |
20 | * reflecting the fact that this will cause the player to die. |
21 | * |
22 | * @param theMove |
23 | * move object representing intended move and its effects. |
24 | * @return false, the player cannot occupy the monster's cell. |
25 | * |
26 | * @see jpacman.model.Guest#meetPlayer(jpacman.model.PlayerMove) |
27 | */ |
28 | @Override |
29 | protected boolean meetPlayer(PlayerMove theMove) { |
30 | assert guestInvariant(); |
31 | assert theMove != null; |
32 | assert !theMove.initialized(); |
33 | theMove.die(); |
34 | return false; |
35 | } |
36 | |
37 | /** |
38 | * @see jpacman.model.Guest#guestType() |
39 | * @return Character encoding for a monster. |
40 | */ |
41 | @Override |
42 | public char guestType() { |
43 | return Guest.MONSTER_TYPE; |
44 | } |
45 | |
46 | } |