Changeset 113d7cf in advance-wars for src/com/medievaltech/advancewars/Map.java
- Timestamp:
- May 9, 2011, 6:23:05 PM (14 years ago)
- Branches:
- master
- Children:
- bdd63ba
- Parents:
- ae564dc
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/com/medievaltech/advancewars/Map.java
rae564dc r113d7cf 1 package com.medievaltech. game;1 package com.medievaltech.advancewars; 2 2 3 import android.graphics.Canvas; 4 import android.graphics.Point; 3 import java.io.*; 4 5 import com.medievaltech.unit.Unit; 6 7 8 import android.graphics.*; 5 9 6 10 public class Map { … … 42 46 } 43 47 48 public void save(PrintWriter p) { 49 p.println(getWidth()); 50 p.println(getHeight()); 51 p.println(offset.x+"x"+offset.y); 52 53 for(int x=0; x<getWidth(); x++) { 54 p.print(grid[x][0].type.ordinal()); 55 for(int y=1; y<getHeight(); y++) 56 p.print(","+grid[x][y].type.ordinal()); 57 p.println(); 58 } 59 60 for(int x=0; x<getWidth(); x++) { 61 for(int y=1; y<getHeight(); y++) { 62 if(grid[x][y].currentUnit != null) { 63 Unit u = grid[x][y].currentUnit; 64 //p.println(u.type); 65 p.println(u.location.x+","+u.location.y); 66 } 67 } 68 } 69 } 70 44 71 public void draw(Canvas c) { 45 72 for(int x=0; x<getWidth(); x++)
Note:
See TracChangeset
for help on using the changeset viewer.