blob: a66f30b3576df3e249a3fa5cf011cd8afffde2f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
package ch.asynk.tankontank.game;
import ch.asynk.tankontank.game.Map;
public class GameStateNone extends GameStateCommon
{
public GameStateNone()
{
super();
}
public GameStateNone(GameCtrl ctrl, Map map)
{
super(ctrl, map);
}
@Override
public void touchDown()
{
if (map.isInPossibleMoves(downHex)) {
ctrl.setState(State.PATH, true);
} else {
unselectHex();
setHex();
selectHex();
}
}
@Override
public void touchUp()
{
if (hexHasUnit()) {
setPawn();
map.showPossibleActions(pawn, hex, true);
} else {
map.showPossibleActions(pawn, hex, false);
unselectHex();
}
}
}
|