MapCell.java
1 package hlt; 2 3 public class MapCell { 4 public final Position position; 5 public int halite; 6 public Ship ship; 7 public Entity structure; 8 9 public MapCell(final Position position, final int halite) { 10 this.position = position; 11 this.halite = halite; 12 } 13 14 public boolean isEmpty() { 15 return ship == null && structure == null; 16 } 17 18 public boolean isOccupied() { 19 return ship != null; 20 } 21 22 public boolean hasStructure() { 23 return structure != null; 24 } 25 26 public void markUnsafe(final Ship ship) { 27 this.ship = ship; 28 } 29 30 public void markSafe() { 31 this.ship = null; 32 } 33 }