Example #1
0
 public void AddAllConnections(ConnectivityMap originMap)
 {
     foreach (var connection in originMap.GetAllConnections())
     {
         AddRoomConnection(connection.Source, connection.Target);
     }
 }
Example #2
0
 public void AddAllConnections(ConnectivityMap originMap)
 {
     foreach (var connection in originMap.GetAllConnections())
     {
         AddRoomConnection(connection.Source, connection.Target);
     }
 }
        public void ConnectionCanBeAddedFromAnotherMap()
        {
            ConnectivityMap newMap = new ConnectivityMap();

            newMap.AddRoomConnection(1, 2);
            newMap.AddRoomConnection(2, 3);

            ConnectivityMap newMap2 = new ConnectivityMap();

            newMap2.AddRoomConnection(3, 4);
            newMap2.AddRoomConnection(4, 5);

            newMap.AddAllConnections(newMap2);

            CollectionAssert.AreEquivalent(new List<Connection>(new Connection[] { new Connection(1, 2), new Connection(2, 3),
                new Connection(3, 4), new Connection(4, 5)}), newMap.GetAllConnections().ToList());
        }
 private Connection GetRandomEdgeInMap(ConnectivityMap generatedMap)
 {
     return generatedMap.GetAllConnections().RandomElementUsing(random);
 }