public static LOSData LosAt(Map map, Vector2Int position, int distance) { if (distance <= 0) { return(new LOSData(0, position)); } LOSData toReturn = new LOSData(distance, position); toReturn.PrecalculateValues(); toReturn.setAt(0, 0, Direction.NORTH, true); for (int d = 0; d < 4; d++) { Quadrant q = new Quadrant((Direction)d, position); Row firstRow = new Row(1, new fraction(-1, 1), new fraction(1, 1), q); Scan(firstRow, toReturn); } toReturn.CollectEntities(map); return(toReturn); }
public static void Reveal(Vector2Int tile, LOSData l, Direction d) { l.setAt(tile.y, tile.x, d, true); }