|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjp.ac.fun.osawalab.tileworld.game.Unit
jp.ac.fun.osawalab.tileworld.game.Tile
public class Tile
Tile
は、タイルを表すユニットです。
タイルは、エージェントが押すことができるオブジェクトです。
フィールドの概要 | |
---|---|
static char |
SYMBOL
タイルを表す文字(「T」)。 |
コンストラクタの概要 | |
---|---|
Tile(int x,
int y)
タイルを生成し、その座標とIDをセットします。 |
|
Tile(Location location)
タイルを生成し、その座標とIDをセットします。 |
メソッドの概要 | |
---|---|
boolean |
canPush(char direction)
タイルを、その方向におせるかどうかを調べます。 |
Agent |
getAgent()
現在、このタイルを押しているエージェントを返します。 |
static boolean |
isTile(char symbol)
ある指定された記号が、タイルを表すものであるかどうか調べます。 |
void |
move(char direction,
Unit pushingUnit)
タイルを指定された方向に動かします。 |
char |
toChar()
タイルを表す文字である、 SYMBOL を返します。 |
クラス jp.ac.fun.osawalab.tileworld.game.Unit から継承されたメソッド |
---|
create, create, getLocation, getNextLocation, getX, getY, isEnterable, setLocation, toCharArray, toString |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
フィールドの詳細 |
---|
public static char SYMBOL
コンストラクタの詳細 |
---|
public Tile(int x, int y)
x
- タイルのx座標。y
- タイルのy座標。public Tile(Location location)
location
- タイルの座標。メソッドの詳細 |
---|
public static boolean isTile(char symbol)
symbol
- 調べたい記号。
Tile#SYMBOL
と等しければ、true。public boolean canPush(char direction)
Unit
内の canPush
direction
- 向かう方向。
Unit.canPush(char)
public char toChar()
SYMBOL
を返します。
Unit
内の toChar
Unit.toChar()
,
SYMBOL
public Agent getAgent()
public void move(char direction, Unit pushingUnit)
direction
- 現在、このタイルが動こうとしている方向。pushingUnit
- 現在、このタイルを押しているユニット。
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |