Beispiel #1
0
            public Graph mapQuantization(bool isBombPassable, bool isDestructiblePassable)
            {
                WorldGraph graph = new WorldGraph (gs.Width * gs.Height);
                LocationData[,] map = this.gs.Map;
                for (int i = 0; i < gs.Width; i++) {
                    for (int j = 0; j < gs.Height; j++) {
                        Coords coords = Coords.coordsXY(i, j, gs.Width, gs.Height);
                        int tileNum = coords.getTileNum ();
                        List<Connection> connections = getLegalConnections (map,
                    tileNum, isBombPassable, isDestructiblePassable);
                        graph.addConnections (tileNum, connections);
                    }
                }

                return graph;
            }