Changeset 1a1e8c7 in advance-wars for src/com/medievaltech/game/Tile.java
- Timestamp:
- Jan 31, 2011, 11:44:53 PM (14 years ago)
- Branches:
- master
- Children:
- 00c432c
- Parents:
- abe7b3d
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/com/medievaltech/game/Tile.java
rabe7b3d r1a1e8c7 1 package com.medievaltech.advancewars; 2 3 import com.medievaltech.game.Unit; 1 package com.medievaltech.game; 4 2 5 3 import android.graphics.Canvas; … … 17 15 public Unit currentUnit; 18 16 public Point point; 17 private Paint p; 19 18 20 public void addUnit(Unit unit) 21 { 19 public Tile(Paint p) { 20 this.p = p; 21 this.currentUnit = null; 22 } 23 24 public Tile(Tile t) { 25 this.type = t.type; 26 this.moveCoefficent = t.moveCoefficent; 27 this.p = t.p; 28 } 29 30 public void addUnit(Unit unit) { 22 31 currentUnit = unit; 23 32 } 24 33 25 public void removeUnit(Unit unit) 26 { 27 if(currentUnit != null) 28 { 34 public void removeUnit(Unit unit) { 35 if(currentUnit != null) { 29 36 currentUnit = null; 30 37 } 31 38 32 39 } 33 private Paint p;34 35 public Tile(Paint p) {36 this.p = p;37 }38 40 39 41 public void draw(Canvas c, int x, int y) { 40 42 c.drawRect(x, y, x+50, y+50, p); 43 44 if(currentUnit != null) 45 currentUnit.draw(c, x+25, y+25); 41 46 } 42 47 }
Note:
See TracChangeset
for help on using the changeset viewer.