Last change
on this file since abe7b3d was abe7b3d, checked in by dportnoy <devnull@…>, 14 years ago |
Changed the package names from com.example.* to com.medievaltech.*
|
-
Property mode
set to
100644
|
File size:
684 bytes
|
Line | |
---|
1 | package com.medievaltech.advancewars;
|
---|
2 |
|
---|
3 | import com.medievaltech.game.Unit;
|
---|
4 |
|
---|
5 | import android.graphics.Canvas;
|
---|
6 | import android.graphics.Paint;
|
---|
7 | import android.graphics.Point;
|
---|
8 |
|
---|
9 | public class Tile {
|
---|
10 | public enum TerrainType
|
---|
11 | {
|
---|
12 | LAND, SEA
|
---|
13 | }
|
---|
14 |
|
---|
15 | TerrainType type;
|
---|
16 | public double moveCoefficent;
|
---|
17 | public Unit currentUnit;
|
---|
18 | public Point point;
|
---|
19 |
|
---|
20 | public void addUnit(Unit unit)
|
---|
21 | {
|
---|
22 | currentUnit = unit;
|
---|
23 | }
|
---|
24 |
|
---|
25 | public void removeUnit(Unit unit)
|
---|
26 | {
|
---|
27 | if(currentUnit != null)
|
---|
28 | {
|
---|
29 | currentUnit = null;
|
---|
30 | }
|
---|
31 |
|
---|
32 | }
|
---|
33 | private Paint p;
|
---|
34 |
|
---|
35 | public Tile(Paint p) {
|
---|
36 | this.p = p;
|
---|
37 | }
|
---|
38 |
|
---|
39 | public void draw(Canvas c, int x, int y) {
|
---|
40 | c.drawRect(x, y, x+50, y+50, p);
|
---|
41 | }
|
---|
42 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.