Beispiel #1
0
        /// <summary>
        /// Constructed with the inputMap and the room id of the PC start location
        /// </summary>
        /// <param name="inputMap"></param>
        /// <param name="startVertex"></param>
        public MapModel(ConnectivityMap inputMap, int startVertex)
        {
            this.inputMap = inputMap;

            baseGraph        = new UndirectedGraph <int, TaggedEdge <int, string> >();
            this.startVertex = startVertex;

            //Clone the input graph (edges only)
            baseGraph.AddVerticesAndEdgeRange(inputMap.RoomConnectionGraph.Edges);

            //Build cycle-free map
            graphNoCycles = new MapCycleReducer(baseGraph.Edges);

            //Build Door and Clue Manager
            //Ensure we pass on the mapped (to no cycles) version of the start vertex
            doorAndClueManager = new DoorAndClueManager(graphNoCycles, graphNoCycles.roomMappingFullToNoCycleMap[startVertex]);

            //Build a random generator (don't keep instantiating them, because they all give the same number if during the same tick!
            random = new Random();
        }
Beispiel #2
0
 public MapHeuristics(MapCycleReducer mapWithoutCycles, int startVertex)
 {
     this.mapWithoutCycles = mapWithoutCycles;
     this.startVertex      = startVertex;
 }