private void Chart(string name, NavGrid.CostQuery seedFunc, NavGrid.CostQuery costFunc) { _charts[name] = new NavQuery() { Grid = new NavGrid(Map.Width, Map.Height), CostFunction = costFunc, SeedFunction = seedFunc }; }
private void UpdateChart(NavGrid nav, NavGrid.CostQuery seeds, NavGrid.CostQuery costs) { nav.Reset(); if (costs != null) { nav.SetSeeds(seeds); nav.SetCosts(costs); } nav.Flood(); }
public void Chart(string name, Func <TileMap, int, int, float> seedCost, NavGrid.CostQuery costFunc) { Chart(name, (x, y) => seedCost(_map, x, y), costFunc); }
public void Chart(string name, Predicate <TileMap.Tile> seedFilter, NavGrid.CostQuery costFunc) { Chart(name, (x, y) => seedFilter(_map[x, y]) ? 0 : -1, costFunc); }