source: advance-wars/src/com/medievaltech/game/Unit.java@ 5d77d43

Last change on this file since 5d77d43 was 5d77d43, checked in by Avil <devnull@…>, 14 years ago

merged Unit

  • Property mode set to 100644
File size: 884 bytes
RevLine 
[abe7b3d]1package com.medievaltech.game;
[a0f5455]2
3import java.util.List;
4
[1a1e8c7]5import android.graphics.Canvas;
6import android.graphics.Paint;
[a0f5455]7import android.graphics.Point;
8
9public abstract class Unit
10{
[15ddb57]11 public enum Type
12 {
13 LAND,SEA
14 }
15
[1a1e8c7]16 private Paint p;
17
[15ddb57]18 public Type type;
19 public Player owner;
20
[a0f5455]21 public int maxHealth;
22 public int currentHealth;
23
24 public int maxFuel;
25 public int currentFuel;
26
27 public int sightRange;
28 public int move;
29
30 public int minAttackRange;
31 public int maxAttackRange;
32 public Point location;
33
[1a1e8c7]34 public Unit(Paint p) {
35 this.p = p;
36 }
37
[5d77d43]38 public abstract void move(Point point);
39 public abstract void attack(Point point);
[a0f5455]40
41 public abstract List<Point> getRange();
42 public abstract List<Point> getAttackRange();
43
[1a1e8c7]44 public void die() {
[a0f5455]45
46 }
47
[1a1e8c7]48 public void draw(Canvas c, int x, int y) {
49 c.drawCircle(x, y, 20, p);
50 }
[a0f5455]51}
Note: See TracBrowser for help on using the repository browser.