com.ltu.smd116.containers
Class Tile


public class Tile

This class describes how a tile is represented

Author:
Marie Larsson

Field Summary
 final static intF_CORRIDOR
           
 final static intF_DECK
           
 final static intF_ELEVATOR
           
 final static intF_NONE
           
 final static intF_RESTRICTED
           
 final static intF_ROOM
           
 final static intF_SHOP
           
 final static intF_STAIR_DN
           
 final static intF_STAIR_UP
           
 private final static Color[]floorColors
           
 private intleftWall
          Indicates the position of the tile's leftWall
 private inttopWall
          Indicates the position of the tile's topWall
 private inttype
          Describe what type the tile is
 final static intW_DOOR
           
 final static intW_NONE
           
 final static intW_OWALL
           
 final static intW_WALL
           

Constructor Summary
Tile(int type, int leftWall, int topWall)
          Constructs a tile with a leftWall and a topWall

Method Summary
 (package private) voiddraw(Graphics g, int x, int y, int w, int h)
          Draws the tile
 intgetLeftWall()
           
 intgetTopWall()
           
 intgetType()
           

Field Detail

F_CORRIDOR

public final static int F_CORRIDOR

F_DECK

public final static int F_DECK

F_ELEVATOR

public final static int F_ELEVATOR

F_NONE

public final static int F_NONE

F_RESTRICTED

public final static int F_RESTRICTED

F_ROOM

public final static int F_ROOM

F_SHOP

public final static int F_SHOP

F_STAIR_DN

public final static int F_STAIR_DN

F_STAIR_UP

public final static int F_STAIR_UP

floorColors

private final static Color[] floorColors

leftWall

private int leftWall
Indicates the position of the tile's leftWall

topWall

private int topWall
Indicates the position of the tile's topWall

type

private int type
Describe what type the tile is

W_DOOR

public final static int W_DOOR

W_NONE

public final static int W_NONE

W_OWALL

public final static int W_OWALL

W_WALL

public final static int W_WALL
Constructor Detail

Tile

public Tile(int type, int leftWall, int topWall)
Constructs a tile with a leftWall and a topWall
Parameters:
type - The type of the tile
leftWall - The aft side of the tile
topWall - The port side of the tile
Method Detail

draw

void draw(Graphics g, int x, int y, int w, int h)
Draws the tile

getLeftWall

public int getLeftWall()

getTopWall

public int getTopWall()

getType

public int getType()

Association Links

to Class java.awt.Color