com.ltu.smd116.containers
Class Floor


public class Floor

Floor is a container for keeping track of the different floors on
board the cruise liner

Author:
Veronica Backlund

Field Summary
 private intheight
           
 private Tile [] []tiles
           
 private intwidth
           

Constructor Summary
Floor(Tile [] [] tiles)
          The constructor for a certain floor, with its tiles

Method Summary
 voiddraw(Graphics g, int w, int h)
          Draws the floor
 (package private) TilegetTile(int x, int y)
          Gets a tile
 (package private) voidsetTile(int x, int y, Tile tile)
          Sets a specific tile on the floor

Field Detail

height

private int height

tiles

private Tile [] [] tiles

width

private int width
Constructor Detail

Floor

public Floor(Tile [] [] tiles)
The constructor for a certain floor, with its tiles
Parameters:
tiles - The floor's tiles
Method Detail

draw

public void draw(Graphics g, int w, int h)
Draws the floor

getTile

Tile getTile(int x, int y)
Gets a tile

setTile

void setTile(int x, int y, Tile tile)
Sets a specific tile on the floor
Parameters:
x - The x-position
y - The y-point
tile - The tile to change