Changeset 41c11dd in advance-wars for src/com/medievaltech/advancewars/Tile.java


Ignore:
Timestamp:
Aug 27, 2011, 1:56:46 AM (13 years ago)
Author:
dportnoy <devnull@…>
Branches:
master
Children:
331d180
Parents:
511177b
Message:

Added cities to the game, moved the map to a new static class, and added incomplete support for capturing cities with soldiers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/com/medievaltech/advancewars/Tile.java

    r511177b r41c11dd  
    1212        public double moveCoefficent;
    1313        public Unit currentUnit;
     14        public City currentBuilding;
    1415        public Point point;
    1516        private Paint p;
     
    1920                this.type = type;
    2021                this.currentUnit = null;
     22                this.currentBuilding = null;
    2123        }
    2224       
     
    4042        }
    4143       
     44        public void addBuilding(City c) {
     45                currentBuilding = c;
     46                c.location = point;
     47        }
     48       
    4249        public void draw(Canvas c, int x, int y) {
    4350                c.drawRect(x, y, x+50, y+50, p);
     
    4855                        currentUnit.draw(c, x+25, y+25);
    4956        }
     57       
     58        public void drawBuilding(Canvas c, int x, int y) {
     59                if(currentBuilding != null)
     60                        currentBuilding.draw(c, x+25, y+25);
     61        }
    5062}
Note: See TracChangeset for help on using the changeset viewer.