Class Door
java.lang.Object
nz.ac.vuw.ecs.swen225.gp6.domain.TileAnatomy.AbstractTile
nz.ac.vuw.ecs.swen225.gp6.domain.TileGroups.Door
- All Implemented Interfaces:
Tile
- Direct Known Subclasses:
BlueLock,ExitDoor,ExitDoorOpen,GreenLock,OrangeLock,YellowLock
An abstract class that all door tiles must inherit.
-
Field Summary
Fields inherited from class nz.ac.vuw.ecs.swen225.gp6.domain.TileAnatomy.AbstractTile
info -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Key.KeyColorcolor()gets the colour of the key of the door (none if not a coloured door, e.g exit door)booleanChecks wether this tile is an obstruction for enemy tile ,in a given domain.booleanChecks wether this tile is an obstruction for hero tile ,in a given domain.voidSets the given tile t instead of this tile on maze, changing the domain to do so.Methods inherited from class nz.ac.vuw.ecs.swen225.gp6.domain.TileAnatomy.AbstractTile
info, symbolMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nz.ac.vuw.ecs.swen225.gp6.domain.TileAnatomy.Tile
damagesHero, ping, replaceWith, type
-
Constructor Details
-
Door
constructor for a Door.- Parameters:
info- instance of tileInfo for a Door
-
-
Method Details
-
color
gets the colour of the key of the door (none if not a coloured door, e.g exit door)- Returns:
- the colour of the key of the door (or none)
-
obstructsEnemy
Description copied from interface:TileChecks wether this tile is an obstruction for enemy tile ,in a given domain. NOTE: does not alter the domain or this tile in anyway.- Parameters:
d- game domain to check on- Returns:
- true if obstructs enemy, if not implemented, defaults to false.
-
obstructsHero
Description copied from interface:TileChecks wether this tile is an obstruction for hero tile ,in a given domain. NOTE: does not alter the domain or this tile in anyway.- Parameters:
d- game domain to check on- Returns:
- true if obstructs hero, if not implemented, defaults to false.
-
setOn
Description copied from interface:TileSets the given tile t instead of this tile on maze, changing the domain to do so. NOTE1: may alter domain. NOTE2: does not check wether it's possible for tile t to move on this tile(thoroughly)! Although often it has a set of exceptions that will be thrown if a completely unexpected input is given.
if not implemented defaults to replacing this tile with given tile on maze.
- Parameters:
t- tile to replace this tile with, can not be null.d- domain where this change is happening, can not be null.
-