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
|
Rev | Line | |
---|
[abe7b3d] | 1 | package com.medievaltech.advancewars;
|
---|
[2e798d9] | 2 |
|
---|
[abe7b3d] | 3 | import com.medievaltech.game.Unit;
|
---|
[a0f5455] | 4 |
|
---|
[2e798d9] | 5 | import android.graphics.Canvas;
|
---|
| 6 | import android.graphics.Paint;
|
---|
[a0f5455] | 7 | import android.graphics.Point;
|
---|
[2e798d9] | 8 |
|
---|
| 9 | public class Tile {
|
---|
[a0f5455] | 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 | }
|
---|
[2e798d9] | 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.