public Tile(directions d, Waypoint wp, waypointTypes type) { this.direction = d; this.wp = wp; this.type = type; if (type.Equals(waypointTypes.StorageLocation) && !d.Equals(directions.EastNorthSouthWest)) { throw new ArgumentException("something went wrong with storage locations"); } if (d.Equals(directions.Invalid)) { throw new ArgumentException("direction invalid"); } if (wp == null) { throw new ArgumentException("wp is null"); } }
public void turnLeft() { if (facing.Equals(directions.N)) { setFacing(directions.W); } else if (facing.Equals(directions.W)) { setFacing(directions.S); } else if (facing.Equals(directions.S)) { setFacing(directions.E); } else if (facing.Equals(directions.E)) { setFacing(directions.N); } }