コード例 #1
0
ファイル: Knowledge.cs プロジェクト: lithander/V7mBot
 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
     };
 }
コード例 #2
0
ファイル: Knowledge.cs プロジェクト: lithander/V7mBot
 private void UpdateChart(NavGrid nav, NavGrid.CostQuery seeds, NavGrid.CostQuery costs)
 {
     nav.Reset();
     if (costs != null)
     {
         nav.SetSeeds(seeds);
         nav.SetCosts(costs);
     }
     nav.Flood();
 }
コード例 #3
0
ファイル: Knowledge.cs プロジェクト: lithander/V7mBot
 public void Chart(string name, Func <TileMap, int, int, float> seedCost, NavGrid.CostQuery costFunc)
 {
     Chart(name, (x, y) => seedCost(_map, x, y), costFunc);
 }
コード例 #4
0
ファイル: Knowledge.cs プロジェクト: lithander/V7mBot
 public void Chart(string name, Predicate <TileMap.Tile> seedFilter, NavGrid.CostQuery costFunc)
 {
     Chart(name, (x, y) => seedFilter(_map[x, y]) ? 0 : -1, costFunc);
 }