| 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectserpiente.Rejilla
public class Rejilla
Esta clase representa una rejilla con una determinada Anchura y Altura, en la que cada celda puede estar VACIA, contener un trozo de SERPIENTE, un RATON, o un BLOQUE (muro)
| Field Summary | |
|---|---|
private  int | 
altura
 | 
private  int | 
anchura
 | 
(package private) static int | 
BLOQUE
 | 
private  int[][] | 
celdas
 | 
(package private) static int | 
RATON
 | 
(package private) static int | 
SERPIENTE
 | 
(package private) static int | 
TIPO_MASCARA
 | 
(package private) static int | 
VACIA
 | 
| Constructor Summary | |
|---|---|
Rejilla(int w,
        int h)
Crea espacio para una rejilla con anchura igual a w y altura igual a h.  | 
|
| Method Summary | |
|---|---|
 void | 
assignTipoCelda(int x,
                int y,
                int valor)
Establece el tipo de celda (VACIA, BLOQUE,SERPIENTE, RATON) en las coordenadas x e y de esta Rejilla  | 
 int | 
getAltura()
Devuelve la altura de la rejilla.  | 
 int | 
getAnchura()
Devuelve la anchura de la rejilla.  | 
 int | 
getTipoCelda(int x,
             int y)
Obtiene el tipo de celda (VACIA, BLOQUE,SERPIENTE, RATON) en las coordenadas x e y de esta Rejilla  | 
private  int | 
getValor(int x,
         int y)
Devuelve el valor almacenado en las coordenadas x e y de esta Rejilla  | 
 void | 
initRejilla()
Pone VACIA como tipo de celda, en todas las celdas de esta Rejilla.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
static final int TIPO_MASCARA
static final int VACIA
static final int BLOQUE
static final int SERPIENTE
static final int RATON
private int anchura
private int altura
private int[][] celdas
| Constructor Detail | 
|---|
Rejilla(int w,
        int h)
| Method Detail | 
|---|
public int getAnchura()
public int getAltura()
private int getValor(int x,
                     int y)
public void assignTipoCelda(int x,
                            int y,
                            int valor)
public int getTipoCelda(int x,
                        int y)
public void initRejilla()
  | 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||