Example #1
0
 /// <summary>
 /// Determine an exit direction based on the current placement logic
 /// </summary>
 /// <param name="logic"></param>
 /// <param name="startDir"></param>
 /// <returns></returns>
 public CompassDirection ExitDirection(ExitPlacement logic, CompassDirection startDir)
 {
     if (logic == ExitPlacement.Opposite || logic == ExitPlacement.Opposite_Side)
     {
         return(startDir);
     }
     else if (logic == ExitPlacement.Not_Opposite_Side)
     {
         return(startDir.RandomTurn(_RNG));
     }
     else
     {
         return(startDir.Reverse().RandomOther(_RNG));
     }
 }
Example #2
0
        public void SetExit(ExitPlacement exitPlacement, int x = 1, int y = 1)
        {
            switch (exitPlacement)
            {
            case ExitPlacement.RandomCorner:
                exitRandomCorner();
                break;

            case ExitPlacement.Random:
                exitRandom();
                break;

            case ExitPlacement.Fixed:
                ex = x; ey = y;
                break;
            }
            cMap[ex, ey] = 'e';
            DrawRectangleInCell(ex, ey, Brushes.Lime);
        }
Example #3
0
 public Level(int[,] GridStartLocations, ExitPlacement exitLocation)
 {
     GridStartLocations = GridStartLocations;
     ExitLocation       = exitLocation;
 }