diff --git a/Maze-WPF/Doolhof.sln b/Maze-WPF/Doolhof.sln new file mode 100644 index 0000000..d0be179 --- /dev/null +++ b/Maze-WPF/Doolhof.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33424.131 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wpf_2D", "Doolhof\Wpf_2D.csproj", "{D47F7DEA-1854-4C5B-A652-DDDF08285F6A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Global", "Logica\Global.csproj", "{3890B9BB-6647-4796-AAEE-76CF0A50FD3D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Logic", "Logic\Logic.csproj", "{59C74047-8A4A-4968-B064-CD6DBF338F3D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wpf_3D", "Wpf_3D\Wpf_3D.csproj", "{D35B6C66-9D23-4F3A-853C-15550B4C0D1E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D47F7DEA-1854-4C5B-A652-DDDF08285F6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D47F7DEA-1854-4C5B-A652-DDDF08285F6A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D47F7DEA-1854-4C5B-A652-DDDF08285F6A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D47F7DEA-1854-4C5B-A652-DDDF08285F6A}.Release|Any CPU.Build.0 = Release|Any CPU + {3890B9BB-6647-4796-AAEE-76CF0A50FD3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3890B9BB-6647-4796-AAEE-76CF0A50FD3D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3890B9BB-6647-4796-AAEE-76CF0A50FD3D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3890B9BB-6647-4796-AAEE-76CF0A50FD3D}.Release|Any CPU.Build.0 = Release|Any CPU + {59C74047-8A4A-4968-B064-CD6DBF338F3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59C74047-8A4A-4968-B064-CD6DBF338F3D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59C74047-8A4A-4968-B064-CD6DBF338F3D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59C74047-8A4A-4968-B064-CD6DBF338F3D}.Release|Any CPU.Build.0 = Release|Any CPU + {D35B6C66-9D23-4F3A-853C-15550B4C0D1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D35B6C66-9D23-4F3A-853C-15550B4C0D1E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D35B6C66-9D23-4F3A-853C-15550B4C0D1E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D35B6C66-9D23-4F3A-853C-15550B4C0D1E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AE57EF3C-8877-450E-B4C8-E0C5DA2ADBF2} + EndGlobalSection +EndGlobal diff --git a/Maze-WPF/Logic/BinaryTreeAlgoritm.cs b/Maze-WPF/Logic/BinaryTreeAlgoritm.cs new file mode 100644 index 0000000..8125c91 --- /dev/null +++ b/Maze-WPF/Logic/BinaryTreeAlgoritm.cs @@ -0,0 +1,245 @@ +using Global; +using Logica; +using System.Drawing; + +namespace Logic { + public class BinaryTreeAlgoritm { + public Maze maze; + private bool isDone = false; + private static readonly Random random = new Random(); + private List oldVisitedCells = new List(); + private List newVisitedCells = new List(); + private Cell stop; + private Cell start; + + public BinaryTreeAlgoritm(Maze maze) { + this.maze = maze; + } + + public void Generate() { + while (!isDone) { + SetAllWalls(); + GenerateCells(100); + GenerateBorder(); + start = CalculateStartStop(1); + stop = CalculateStartStop(maze.length - 2); + SolveMaze(start); + } + if (isDone) { + SetWalls(); + } + } + + /// + /// Generate Maze cel by cel + /// + /// + private void GenerateCells(int placepercentage) { + for (int y = 0; y < maze.height; y++) { + for (int x = 0; x < maze.length; x++) { + if (y % 2 == 0 && x % 2 == 0) { + FillCell(x, y); + } + else { + if (GetRandomNumber(placepercentage) >= 49) { + if (x < maze.length - 1) { + FillCell(x + 1, y); + } + } + else { + if (y < maze.height - 1) { + FillCell(x, y + 1); + } + } + } + + + } + } + } + + private void SetAllWalls() { + foreach (Cell cell in maze.cels) { + maze.cels[cell.x, cell.y].isWall = true; + } + } + + /// + /// Return a random number + /// + /// + /// + private int GetRandomNumber(int placepercentage) { + int randomInt = random.Next(placepercentage); + return randomInt; + } + + + /// + /// Mark cell as visited and color it + /// + /// + /// + private void FillCell(int x, int y) { + maze.cels[x, y].color = Color.Black; + maze.cels[x, y].isWall = false; + } + + + + /// + /// Generate borders + /// + private void GenerateBorder() { + for (int i = 0; i < maze.length; i++) { + maze.cels[i, 0].color = Color.Red; + maze.cels[i, 0].isWall = true; + maze.cels[i, maze.length - 1].color = Color.Red; + maze.cels[i, maze.length - 1].isWall = true; + } + + for (int j = 0; j < maze.height - 1; j++) { + maze.cels[0, j].color = Color.Red; + maze.cels[0, j].isWall = true; + maze.cels[maze.height - 1, j].color = Color.Red; + maze.cels[maze.height - 1, j].isWall = true; + } + } + + /// + /// Find a usable cell in a row for the start or the stop of the maze. + /// + /// + private Cell CalculateStartStop(int x) { + Cell cel = new Cell(); + if (x >= 0 && x < maze.length) { + for (int i = 0; i < maze.length; i++) { + Random random = new Random(); + int randomY = random.Next(0, maze.length); + if (maze.cels[x, randomY].color == Color.Black) { + if (x == 1) { + maze.ball = new Ball(); + maze.ball.SetLocation(x, randomY); + } + else { + maze.cels[x, randomY].color = Color.Blue; + } + maze.cels[x, randomY].visited = true; + maze.cels[x, randomY].isWall = false; + cel.setLocation(x, randomY); + cel.id = maze.cels[x, randomY].id; + break; + } + } + } + return cel; + } + + + /// + /// Solve the maze with an algoritm to see if its solvable + /// + /// + private void SolveMaze(Cell start) { + bool solved = false; + oldVisitedCells.Add(start); + while (!solved && !isDone) { + solved = true; + foreach (Cell cell in oldVisitedCells.ToList()) { + if (FillInAvailableNeighbours(cell.x, cell.y)) { + if (!(cell.color == Color.Red)) { + solved = false; + + } + } + } + oldVisitedCells = newVisitedCells.ToList(); + newVisitedCells.Clear(); + + } + + } + + /// + /// See if the neighbouring cells are available + /// + /// + /// + /// + private bool FillInAvailableNeighbours(int x, int y) { + bool isOk = false; + if (!IsVisited(x + 1, y)) { + SetVisited(x + 1, y); + isOk = true; + } + if (!IsVisited(x - 1, y)) { + SetVisited(x - 1, y); + isOk = true; + } + if (!IsVisited(x, y + 1)) { + SetVisited(x, y + 1); + isOk = true; + } + if (!IsVisited(x, y - 1)) { + SetVisited(x, y - 1); + isOk = true; + } + + return (isOk); + + } + + /// + /// Return if the cell has been visited + /// + /// + /// + /// + private bool IsVisited(int x, int y) { + if (maze.cels[x, y].id == stop.id) { + isDone = true; + } + if (x >= 0 && x < maze.length && y >= 0 && y < maze.height) { + if (maze.cels[x, y].isWall == false) { + return maze.cels[x, y].visited; + } + else return true; + } + else if (x == -1 || y == -1 || x == maze.length || y == maze.height) { + return true; + } + else { + return true; + } + } + + /// + /// Set the cell as visited to prevent index array errors + /// + /// + /// + private void SetVisited(int x, int y) { + Cell cell = maze.cels[x, y]; + cell.setLocation(x, y); + if (cell.isWall == false && cell.visited == false) { + cell.visited = true; + newVisitedCells.Add(cell); + } + + } + + /// + /// Not too proud of this fix + /// + private void SetWalls() { + for (int x = 0; x < maze.length; x++) { + for (int y = 0; y < maze.height; y++) { + if (maze.cels[x, y].color == Color.Red) { + maze.cels[x, y].isWall = true; + } + } + } + + } + } +} diff --git a/Maze-WPF/Logic/DepthFirstAlgoritm.cs b/Maze-WPF/Logic/DepthFirstAlgoritm.cs new file mode 100644 index 0000000..11f7511 --- /dev/null +++ b/Maze-WPF/Logic/DepthFirstAlgoritm.cs @@ -0,0 +1,321 @@ +using Global; +using Logica; +using System.Drawing; + +namespace Logic { + + public class DepthFirstAlgoritm { + public Maze maze; + public bool isDone = false; + private static readonly Random random = new Random(); + private int x; + private int y; + private int attempts = 0; + private bool goodStep; + private int startcellId; + public DepthFirstAlgoritm(Maze maze) { + this.maze = maze; + x = 0; + y = 0; + } + + /// + /// Generate the maze. + /// + public void Generate() { + maze.length--; + maze.height--; + CalculateIdStartCell(); + while (isDone == false) { + SetStep(); + } + CalculateStartStop(1); + CalculateStartStop(maze.length - 1); + maze.height++; + maze.length++; + GenerateBorder(); + SetWalls(); + } + + /// + /// Set a step in a random direction. If there are too many unsuccesfull attempts it will force a step + /// + private void SetStep() { + goodStep = false; + attempts = 0; + while (goodStep == false && isDone == false) { + goodStep = false; + int tempX = x; + int tempY = y; + if (attempts > 5) { + ForceStep(); + break; + } + else { + Direction direction = GenerateRandomMovement(); + switch (direction) { + case Direction.up: tempY = y - 1; break; + case Direction.down: tempY = y + 1; break; + case Direction.right: tempX = x + 1; break; + case Direction.left: tempX = x - 1; break; + } + if (tempY >= 1 && tempX >= 1 && tempX < maze.length && tempY < maze.height) { + if (CheckStepInvalid(tempX, tempY) || CheckNeighbours(x, y, tempX, tempY)) { + attempts = attempts + 1; + } + else { + x = tempX; + y = tempY; + maze.cels[x, y].SetVisited(true); + maze.cels[x, y].color = Color.Red; + goodStep = true; + } + } + else { + attempts = attempts + 1; + } + } + } + + } + + /// + /// will force check every direction for a good step. + /// + private void ForceStep() { + if (CheckStepInvalid((x + 1), y) == false && CheckNeighbours(x, y, x + 1, y) == false) { + goodStep = true; + x++; + } + else if (CheckStepInvalid((x - 1), y) == false && CheckNeighbours(x, y, x - 1, y) == false) { + goodStep = true; + x--; + } + else if (CheckStepInvalid(x, (y + 1)) == false && CheckNeighbours(x, y, x, y + 1) == false) { + goodStep = true; + y++; + } + else if (CheckStepInvalid(x, (y - 1)) == false && CheckNeighbours(x, y, x, y - 1) == false) { + goodStep = true; + y--; + } + if (goodStep) { + maze.cels[x, y].SetVisited(true); + maze.cels[x, y].color = Color.Red; + attempts = 0; + } + if (goodStep == false) { + BacktrackStep(); + } + } + + /// + /// Backstep in a random direction untill a good step has been found + /// if the step is back to the startcell then the maze is done. + /// + private void BacktrackStep() { + int tempY = y; + int tempX = x; + maze.cels[x, y].isBacktracked = true; + Direction[] directions = Enum.GetValues(typeof(Direction)) + .Cast() + .OrderBy(_ => Guid.NewGuid()) + .ToArray(); + //Random order + foreach (Direction direction in directions) { + switch (direction) { + case Direction.up: tempY = y - 1; break; + case Direction.down: tempY = y + 1; break; + case Direction.right: tempX = x + 1; break; + case Direction.left: tempX = x - 1; break; + } + if (IsVisited(tempX, tempY) == true) { + y = tempY; + x = tempX; + maze.cels[x, y].color = Color.Black; + break; + } + } + if (maze.cels[x, y].id == startcellId) { + isDone = true; + } + + } + + + /// + /// Check if a cell has a neighbouring cell that has been visited + /// + /// + /// + /// + /// + /// + private bool CheckNeighbours(int x1, int y1, int x2, int y2) { + bool notOk = false; + + // Check adjacent neighbors + if (IsVisited(x2 + 1, y2) && x2 + 1 != x1) { + notOk = true; + } + else if (IsVisited(x2 - 1, y2) && x2 - 1 != x1) { + notOk = true; + } + else if (IsVisited(x2, y2 + 1) && y2 + 1 != y1) { + notOk = true; + } + else if (IsVisited(x2, y2 - 1) && y2 - 1 != y1) { + notOk = true; + } + + // Check diagonal neighbors + if (IsVisited(x2 + 1, y2 + 1) && x2 + 1 != x1 && y2 + 1 != y1) { + notOk = true; + } + else if (IsVisited(x2 - 1, y2 - 1) && x2 - 1 != x1 && y2 - 1 != y1) { + notOk = true; + } + else if (IsVisited(x2 + 1, y2 - 1) && x2 + 1 != x1 && y2 - 1 != y1) { + notOk = true; + } + else if (IsVisited(x2 - 1, y2 + 1) && x2 - 1 != x1 && y2 + 1 != y1) { + notOk = true; + } + + return notOk; + } + + + + /// + /// Check if a cell has been visited to prevent array out of bounds errors + /// + /// + /// + /// + private bool IsVisited(int x, int y) { + if (x >= 1 && x < maze.length && y >= 1 && y < maze.height) { + return maze.cels[x, y].visited; + } + else if (x == 0 || y == 0 || x == maze.length || y == maze.height) { + return false; + //wall, so can ignore + } + else { + return true; + } + } + + /// + /// Generate a random direction + /// + /// + /// + private Direction GenerateRandomMovement() { + int randomNumber = random.Next(1, 5); + switch (randomNumber) { + case 1: + return Direction.up; + case 2: + return Direction.down; + case 3: + return Direction.left; + case 4: + return Direction.right; + default: + throw new InvalidOperationException("Invalid random number generated."); + } + } + + /// + /// Pick random cell at the left side to generate the maze from + /// + private void CalculateIdStartCell() { + y = random.Next(1, maze.height - 1); + x = random.Next(1, maze.length - 1); + startcellId = maze.cels[x, y].id; + maze.cels[x, y].SetVisited(true); + } + + /// + /// Find a usable cell in a row for the start or the stop of the maze. + /// + /// + private void CalculateStartStop(int x) { + if (x >= 1 && x < maze.length) { + for (int i = 1; i < maze.length; i++) { + Random random = new Random(); + int randomY = random.Next(0, maze.length); + if (maze.cels[x, randomY].color == Color.Black) { + if (x == 1) { + maze.ball = new Ball(); + maze.ball.SetLocation(x, randomY); + } + else { + maze.cels[x, randomY].color = Color.Blue; + Cell endCell = new Cell(); + endCell.setLocation(x, randomY); + maze.endCell = endCell; + } + break; + } + } + } + } + + + public void GenerateBorder() { + int width = maze.length; + int height = maze.height; + + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + if (x == 0 || x == width - 1 || y == 0 || y == height - 1) { + maze.cels[x, y].isWall = true; + } + } + } + } + + + + /// + /// Check if a step is invalid + /// + /// + /// + /// + private bool CheckStepInvalid(int x, int y) { + bool isInvalid = true; + if (x >= 1 && x < maze.length && y >= 1 && y < maze.height) { + if (x < maze.length && x >= 1 && isInvalid != false) { + isInvalid = false; + } + if (y < maze.height && y >= 1 && isInvalid != false) { + isInvalid = false; + } + if (IsVisited(x, y) == true) { + isInvalid = true; + } + + } + return isInvalid; + } + + + /// + /// Not too proud of this fix + /// + private void SetWalls() { + for (int x = 0; x < maze.length; x++) { + for (int y = 0; y < maze.height; y++) { + if (maze.cels[x, y].color == Color.Red) { + maze.cels[x, y].isWall = true; + } + } + } + + } + + } +} \ No newline at end of file diff --git a/Maze-WPF/Logic/Logic.csproj b/Maze-WPF/Logic/Logic.csproj new file mode 100644 index 0000000..4c1a418 --- /dev/null +++ b/Maze-WPF/Logic/Logic.csproj @@ -0,0 +1,13 @@ + + + + net7.0 + enable + enable + + + + + + + diff --git a/Maze-WPF/Logic/PhysicsEngine.cs b/Maze-WPF/Logic/PhysicsEngine.cs new file mode 100644 index 0000000..df68593 --- /dev/null +++ b/Maze-WPF/Logic/PhysicsEngine.cs @@ -0,0 +1,155 @@ +using Global; +using Logica; + +namespace Logic { + public class PhysicsEngine { + public Ball ball { get; set; } + + private Maze maze; + private double timeInterval = 0.1; //(100ms) + public bool isFinished = false; + double Dv = 0; + double Dh = 0; + private double elasticity = 0.5; + + + public PhysicsEngine(Ball ball, Maze maze) { + this.ball = ball; + this.maze = maze; + } + + + /// + /// Checks for collisions on both axis + /// + /// + /// + public void CheckForCollision(double x, double y) { + CheckXAxis(x); + CheckYAxis(y); + } + + /// + /// Check the x axis for collisions + /// + /// + internal void CheckXAxis(double x) { + double arrayX = x - 0.5; + bool directionCheck = ball.x > x; // true for left, false for right + + bool axisCheck = false; + + for (double i = -ball.size; i <= ball.size; i += 0.1) { + double checkX = directionCheck ? arrayX - ball.size : arrayX + ball.size; + double checkY = ball.y - 0.5 + i; + + if (maze.cels[RoundToNearest(checkX), RoundToNearest(checkY)].isWall) { + axisCheck = true; + break; + } + } + + if (!axisCheck) { + ball.x = x; + } + else { + Dv = -Dv * elasticity; + } + } + + + + + /// + /// Check if the y axis collides with the edge + /// + /// + internal void CheckYAxis(double y) { + double arrayY = y - 0.5; + bool directionCheck = ball.y > y; // true for up, false for down + + bool axisCheck = false; + + for (double i = -ball.size; i <= ball.size; i += 0.1) { + double checkX = ball.x - 0.5 + i; + double checkY = directionCheck ? arrayY - ball.size : arrayY + ball.size; + + if (maze.cels[RoundToNearest(checkX), RoundToNearest(checkY)].isWall) { + axisCheck = true; + break; + } + } + + if (!axisCheck) { + ball.y = y; + } + else { + Dh = -Dh * elasticity; + } + } + + + + + + /// + /// Check if the ball is in the end cell. + /// + /// + internal bool CheckFinished() { + double tolerance = 0.5; // Adjust the tolerance as needed + + if (Math.Abs(ball.x - maze.endCell.x) < tolerance && Math.Abs(ball.y - maze.endCell.y) < tolerance) { + return true; + } + else { + return false; + } + } + + + + //round double to the nearest integer + public int RoundToNearest(double value) { + return (int)Math.Ceiling(value); + } + + /// + /// Calculate angle to x and y forces + /// + /// + /// + /// + public Ball CalculateAngleMovement(double vertR, double horzR) { + double radianAngleX = vertR * (Math.PI / 180); + double radianAngleY = horzR * (Math.PI / 180); + + double aX = 9.81 * Math.Sin(radianAngleX); + double aY = 9.81 * Math.Sin(radianAngleY); + Dh += (1.0 / 2.0) * aX * Math.Pow(timeInterval, 2); + Dv += (1.0 / 2.0) * aY * Math.Pow(timeInterval, 2); + + AddFriction(); + double nextX = ball.x + Dv; + double nextY = ball.y - Dh; + CheckForCollision(nextX, nextY); + if (CheckFinished()) { + isFinished = true; + } + else { + isFinished = false; + } + return ball; + } + + /// + /// Add friction the the ball + /// + private void AddFriction() { + double friction = 0.15; + Dv *= (1.0 - friction * timeInterval); + Dh *= (1.0 - friction * timeInterval); + } + + } +} diff --git a/Maze-WPF/Logic/StaticMazeGenerator.cs b/Maze-WPF/Logic/StaticMazeGenerator.cs new file mode 100644 index 0000000..3901f4f --- /dev/null +++ b/Maze-WPF/Logic/StaticMazeGenerator.cs @@ -0,0 +1,92 @@ +using Global; +using Logica; +using System.Drawing; + +namespace Logic { + public class StaticMazeGenerator { + public Maze maze; + + public StaticMazeGenerator() { + maze = new Maze(20, 20); + maze.GenerateGrid(Color.Black); + GenerateStaticMaze(); + } + + /// + /// First set the border of the maze. + /// Then call the GenerateWallls() methode to fill in the rest of the maze + /// &set the start and end cell. + /// + public void GenerateStaticMaze() { + for (int x = 0; x < maze.length; x++) { + maze.cels[x, 0].isWall = true; + maze.cels[x, maze.height - 1].isWall = true; + maze.cels[x, 0].color = Color.Red; + maze.cels[x, maze.height - 1].color = Color.Red; + } + for (int y = 0; y < maze.height; y++) { + maze.cels[0, y].isWall = true; + maze.cels[maze.length - 1, y].isWall = true; + maze.cels[0, y].color = Color.Red; + maze.cels[maze.length - 1, y].color = Color.Red; + + } + + // Set the start & stop cell + maze.ball = new Ball(); + maze.ball.SetLocation(1, 2); + maze.cels[18, 16].color = Color.Blue; + maze.endCell = maze.cels[18, 16]; + Cell endCell = new Cell(); + endCell.setLocation(maze.length - 2, maze.height - 2); + maze.endCell = endCell; + + GenerateWalls(); + } + + /// + /// Set the maze using a static list of id's that are walls. + /// + private void GenerateWalls() { + //list of ids + List wallIds = new List { + 0, 20, 40, 60, 80, 100, 120, 140, 160, 180, + 200, 220, 240, 260, 280, 300, 320, 340, 360, 380, + 1, 21, 121, 141, 261, 361, 381, 2, 62, 102, 122, + 182, 222, 302, 322, 382, 3, 43, 63, 163, 183, 203, + 223, 263, 283, 303, 323, 343, 383, 4, 64, 84, 104, + 124, 144, 164, 264, 304, 344, 384, 5, 45, 65, 205, + 225, 245, 265, 385, 6, 26, 46, 106, 126, 146, 166, + 186, 206, 226, 266, 286, 326, 346, 366, 386, 7, 87, + 107, 127, 167, 227, 267, 287, 327, 347, 387, 8, 48, + 68, 88, 208, 228, 388, 9, 89, 109, 149, 169, 269, + 309, 349, 369, 389, 10, 50, 90, 170, 190, 210, 230, + 250, 270, 290, 310, 370, 390, 11, 31, 51, 91, 131, + 231, 291, 311, 331, 391, 12, 92, 112, 132, 152, 172, + 192, 212, 232, 272, 292, 372, 392, 13, 33, 73, 93, + 113, 193, 213, 273, 333, 353, 373, 393, 14, 34, 94, + 114, 154, 234, 254, 274, 294, 334, 394, 15, 75, 95, + 155, 175, 195, 215, 235, 255, 335, 355, 395, 16, 56, + 76, 136, 156, 196, 236, 256, 296, 316, 336, 396, 17, + 57, 117, 137, 317, 377, 397, 18, 98, 118, 178, 218, + 258, 278, 358, 378, 398, 19, 39, 59, 79, 99, 119, + 139, 159, 179, 199, 219, 239, 259, 279, 299, 319, 339, + 359, 379, 399 + }; + var wallCells = wallIds.Select(id => new { X = id % maze.length, Y = id / maze.length }); + + foreach (var cell in wallCells) { + int x = cell.X; + int y = cell.Y; + + if (x > 0 && x < maze.length && y > 0 && y < maze.height) { + maze.cels[x, y].isWall = true; + maze.cels[x, y].color = Color.Red; + } + } + } + + } +} + + diff --git a/Maze-WPF/Logic/WallsCreationAlgoritm.cs b/Maze-WPF/Logic/WallsCreationAlgoritm.cs new file mode 100644 index 0000000..4095a3d --- /dev/null +++ b/Maze-WPF/Logic/WallsCreationAlgoritm.cs @@ -0,0 +1,373 @@ +using Global; +using Logica; +using System.Drawing; + +namespace Logic { + public class WallsCreationAlgoritm { + public Maze maze; + public bool isDone = false; + public int wallpercentage = 25; + public int destructionpercentage = 15; + private static readonly Random random = new Random(); + private List Rows = new List(); + private List Columns = new List(); + private List oldVisitedCells = new List(); + private List newVisitedCells = new List(); + private Cell stopid; + + public WallsCreationAlgoritm(Maze maze) { + this.maze = maze; + } + + public void Generate() { + CreateWalls(false); // Create walls for columns + CreateWalls(true); // Create walls for rows + PlaceWalls(); + GenerateBorder(); + Cell startid = CalculateStartStop(1); + stopid = CalculateStartStop(maze.length - 2); + SolveMaze(startid); + SetWalls(); + + } + + + /// + /// Source: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/conditional-operator + /// + /// + private void CreateWalls(bool forRows) { + int rowCount = maze.height; //rows + int colCount = maze.length; //columns + + for (int i = 2; i < (forRows ? rowCount - 2 : colCount - 2); i++) { + if (!HasAdjacentFilledRow(i, forRows) && random.Next(100) < wallpercentage) { + if (forRows) { + Rows.Add(i); + } + else { + Columns.Add(i); + } + } + } + } + + /// + /// Check if an adjacent row is not filled so theres always a gap + /// + /// + /// + /// + private bool HasAdjacentFilledRow(int index, bool RowColumn) { + if (RowColumn) { + if (Rows.Contains(index - 1) || Rows.Contains(index + 1)) { + return true; + } + else { + return false; + } + } + else { + if (Columns.Contains(index - 1) || Columns.Contains(index + 1)) { + return true; + } + else { + return false; + } + } + } + + /// + /// Place the vertical and horizontal walls + /// + private void PlaceWalls() { + foreach (int x in Columns) { + int[] randomIndex = Randomize(maze.height); + bool oneGapPlaced = false; + while (oneGapPlaced == false) { + for (int i = 0; i < maze.height; i++) { + int y = randomIndex[i]; + if (!maze.cels[x, y].isWall) { + if (!oneGapPlaced) { + if (random.Next(100) < 15 && CheckCentrumOfCross(x, y)) { + oneGapPlaced = true; + continue; // gap + } + } + maze.cels[x, y].isWall = true; + maze.cels[x, y].color = Color.Red; + } + } + + } + MakeGap(x, false); + } + + foreach (int y in Rows) { + int[] randomIndex = Randomize(maze.length); + bool gapPlaced = false; + while (gapPlaced == false) { + for (int i = 0; i < maze.length; i++) { + int x = randomIndex[i]; + if (!maze.cels[x, y].isWall) { + if (!gapPlaced) { + if (random.Next(100) < 15 && CheckCentrumOfCross(x, y)) { + gapPlaced = true; + continue; //gap + } + } + maze.cels[x, y].isWall = true; + maze.cels[x, y].color = Color.Red; + } + } + } + MakeGap(y, true); + } + } + + /// + /// Make a gap + /// + /// + /// + private void MakeGap(int xy, bool forRows) { + for (int i = 1; i < (forRows ? maze.height - 1 : maze.length - 1); i++) { + if (random.Next(100) < destructionpercentage && (forRows ? CheckCentrumOfCross(i, xy) : CheckCentrumOfCross(xy, i))) { + if (forRows) { + maze.cels[i, xy].isWall = false; + //maze.cels[i, xy].visited = false; + maze.cels[i, xy].color = Color.Black; + } + else { + maze.cels[xy, i].isWall = false; + // maze.cels[xy, i].visited = false; + maze.cels[xy, i].color = Color.Black; + + } + } + } + } + + /// + /// Check if an empty cell is not surrounded by walls. + /// + /// + /// + /// + private bool CheckCentrumOfCross(int x, int y) { + int i = 0; + if (!(x - 1 < 0 || x + 1 >= maze.length || y - 1 < 0 || y + 1 >= maze.height)) { + if (maze.cels[x + 1, y].color == Color.Red) { + i++; + } + if (maze.cels[x - 1, y].color == Color.Red) { + i++; + } + if (maze.cels[x, y + 1].color == Color.Red) { + i++; + } + if (maze.cels[x, y - 1].color == Color.Red) { + i++; + } + } + if (i >= 3) { + return false; + } + else { + return true; + } + + + } + + /// + /// Taken from https://stackoverflow.com/questions/56378647/fisher-yates-shuffle-in-c-sharp + /// + /// + /// + private int[] Randomize(int size) { + int[] index = new int[size]; + for (int i = 0; i < size; i++) { + index[i] = i; + } + for (int i = size - 1; i > 0; i--) { + int j = random.Next(0, i + 1); + int temp = index[i]; + index[i] = index[j]; + index[j] = temp; + } + + return index; + } + + /// + /// Find a usable cell in a row for the start or the stop of the maze. + /// + /// + private Cell CalculateStartStop(int x) { + Cell cel = new Cell(); + if (x >= 0 && x < maze.length) { + for (int i = 0; i < maze.length; i++) { + Random random = new Random(); + int randomY = random.Next(0, maze.length); + if (maze.cels[x, randomY].color == Color.Black) { + if (x == 1) { + maze.ball = new Ball(); + maze.ball.SetLocation(x, randomY); + } + else { + maze.cels[x, randomY].color = Color.Blue; + } + maze.cels[x, randomY].isWall = false; + cel.setLocation(x, randomY); + cel.id = maze.cels[x, randomY].id; + break; + } + } + } + return cel; + } + + /// + /// Create a border + /// + private void GenerateBorder() { + for (int i = 0; i < maze.length; i++) { + maze.cels[i, 0].color = Color.Red; + maze.cels[i, 0].isWall = true; + maze.cels[i, maze.length - 1].color = Color.Red; + maze.cels[i, maze.length - 1].isWall = true; + } + + for (int j = 0; j < maze.height - 1; j++) { + maze.cels[0, j].color = Color.Red; + maze.cels[0, j].isWall = true; + maze.cels[maze.height - 1, j].color = Color.Red; + maze.cels[maze.height - 1, j].isWall = true; + } + } + + /// + /// Solve the maze with an algoritm to see if its solvable + /// + /// + private void SolveMaze(Cell start) { + int i = 0; + while (!isDone && i < 1) { + bool solved = false; + oldVisitedCells.Add(start); + while (!solved && !isDone) { + solved = true; + foreach (Cell cell in oldVisitedCells.ToList()) { + if (FillInAvailableNeighbours(cell.x, cell.y)) { + solved = false; + } + if (isDone) { + break; + } + } + oldVisitedCells = newVisitedCells.ToList(); + newVisitedCells.Clear(); + + } + if (!isDone && i < 1) { + MakeAdditionalGaps(); + i++; + } + } + + } + + /// + /// Make additional gaps + /// + private void MakeAdditionalGaps() { + foreach (int x in Columns) { + MakeGap(x, false); + } + foreach (int y in Rows) { + MakeGap(y, true); + + } + } + + /// + /// See if the neighbouring cells are available + /// + /// + /// + /// + private bool FillInAvailableNeighbours(int x, int y) { + bool isOk = false; + if (!IsVisited(x + 1, y)) { + SetVisited(x + 1, y); + isOk = true; + } + if (!IsVisited(x - 1, y)) { + SetVisited(x - 1, y); + isOk = true; + } + if (!IsVisited(x, y + 1)) { + SetVisited(x, y + 1); + isOk = true; + } + if (!IsVisited(x, y - 1)) { + SetVisited(x, y - 1); + isOk = true; + } + return (isOk); + + } + + /// + /// Set the cell as visited to prevent index array errors + /// + /// + /// + private void SetVisited(int x, int y) { + Cell cell = maze.cels[x, y]; + cell.setLocation(x, y); + if (cell.isWall == false && cell.visited == false) { + //cell.color = Color.White; + cell.visited = true; + newVisitedCells.Add(cell); + if (cell.id == stopid.id) { + isDone = true; + } + } + + } + + /// + /// Return if the cell has been visited + /// + /// + /// + /// + private bool IsVisited(int x, int y) { + if (x >= 0 && x < maze.length && y >= 0 && y < maze.height) { + return maze.cels[x, y].visited; + } + else if (x == -1 || y == -1 || x == maze.length || y == maze.height) { + return true; + } + else { + return true; + } + } + + /// + /// Not too proud of this fix + /// + private void SetWalls() { + for (int x = 0; x < maze.length; x++) { + for (int y = 0; y < maze.height; y++) { + if (maze.cels[x, y].color == Color.Red) { + maze.cels[x, y].isWall = true; + } + } + } + + } + } +} diff --git a/Maze-WPF/Logic/bin/Debug/net7.0/Global.dll b/Maze-WPF/Logic/bin/Debug/net7.0/Global.dll new file mode 100644 index 0000000..d70d2ec Binary files /dev/null and b/Maze-WPF/Logic/bin/Debug/net7.0/Global.dll differ diff --git a/Maze-WPF/Logic/bin/Debug/net7.0/Global.pdb b/Maze-WPF/Logic/bin/Debug/net7.0/Global.pdb new file mode 100644 index 0000000..63a4af0 Binary files /dev/null and b/Maze-WPF/Logic/bin/Debug/net7.0/Global.pdb differ diff --git a/Maze-WPF/Logic/bin/Debug/net7.0/Logic.deps.json b/Maze-WPF/Logic/bin/Debug/net7.0/Logic.deps.json new file mode 100644 index 0000000..bbacc78 --- /dev/null +++ b/Maze-WPF/Logic/bin/Debug/net7.0/Logic.deps.json @@ -0,0 +1,36 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v7.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v7.0": { + "Logic/1.0.0": { + "dependencies": { + "Global": "1.0.0" + }, + "runtime": { + "Logic.dll": {} + } + }, + "Global/1.0.0": { + "runtime": { + "Global.dll": {} + } + } + } + }, + "libraries": { + "Logic/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Global/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/Maze-WPF/Logic/bin/Debug/net7.0/Logic.dll b/Maze-WPF/Logic/bin/Debug/net7.0/Logic.dll new file mode 100644 index 0000000..14cfaf1 Binary files /dev/null and b/Maze-WPF/Logic/bin/Debug/net7.0/Logic.dll differ diff --git a/Maze-WPF/Logic/bin/Debug/net7.0/Logic.pdb b/Maze-WPF/Logic/bin/Debug/net7.0/Logic.pdb new file mode 100644 index 0000000..f17ffb1 Binary files /dev/null and b/Maze-WPF/Logic/bin/Debug/net7.0/Logic.pdb differ diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/Logic.AssemblyInfo.cs b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.AssemblyInfo.cs new file mode 100644 index 0000000..0107ca7 --- /dev/null +++ b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.AssemblyInfo.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("Logic")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("Logic")] +[assembly: System.Reflection.AssemblyTitleAttribute("Logic")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/Logic.AssemblyInfoInputs.cache b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.AssemblyInfoInputs.cache new file mode 100644 index 0000000..9d17235 --- /dev/null +++ b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +55bfe306e4c1a29ea5a87d332ae418f3fee8f1af diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/Logic.GeneratedMSBuildEditorConfig.editorconfig b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..d778905 --- /dev/null +++ b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,11 @@ +is_global = true +build_property.TargetFramework = net7.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = Logic +build_property.ProjectDir = C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\ diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/Logic.GlobalUsings.g.cs b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.GlobalUsings.g.cs new file mode 100644 index 0000000..ac22929 --- /dev/null +++ b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/Logic.assets.cache b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.assets.cache new file mode 100644 index 0000000..bb274b4 Binary files /dev/null and b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.assets.cache differ diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/Logic.csproj.AssemblyReference.cache b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.csproj.AssemblyReference.cache new file mode 100644 index 0000000..e5bfd53 Binary files /dev/null and b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.csproj.AssemblyReference.cache differ diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/Logic.csproj.BuildWithSkipAnalyzers b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.csproj.BuildWithSkipAnalyzers new file mode 100644 index 0000000..e69de29 diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/Logic.csproj.CopyComplete b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/Logic.csproj.CoreCompileInputs.cache b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..0f24814 --- /dev/null +++ b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +0e9e05df1406f32298502346ed2f5919e1676f26 diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/Logic.csproj.FileListAbsolute.txt b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..0419b34 --- /dev/null +++ b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.csproj.FileListAbsolute.txt @@ -0,0 +1,15 @@ +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\bin\Debug\net7.0\Logic.deps.json +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\bin\Debug\net7.0\Logic.dll +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\bin\Debug\net7.0\Logic.pdb +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\bin\Debug\net7.0\Global.dll +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\bin\Debug\net7.0\Global.pdb +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\obj\Debug\net7.0\Logic.csproj.AssemblyReference.cache +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\obj\Debug\net7.0\Logic.GeneratedMSBuildEditorConfig.editorconfig +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\obj\Debug\net7.0\Logic.AssemblyInfoInputs.cache +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\obj\Debug\net7.0\Logic.AssemblyInfo.cs +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\obj\Debug\net7.0\Logic.csproj.CoreCompileInputs.cache +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\obj\Debug\net7.0\Logic.csproj.CopyComplete +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\obj\Debug\net7.0\Logic.dll +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\obj\Debug\net7.0\refint\Logic.dll +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\obj\Debug\net7.0\Logic.pdb +C:\Users\ruben\source\repos\2324-ap-rubenschoonbaert\Doolhof\Logic\obj\Debug\net7.0\ref\Logic.dll diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/Logic.dll b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.dll new file mode 100644 index 0000000..14cfaf1 Binary files /dev/null and b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.dll differ diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/Logic.pdb b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.pdb new file mode 100644 index 0000000..f17ffb1 Binary files /dev/null and b/Maze-WPF/Logic/obj/Debug/net7.0/Logic.pdb differ diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/ref/Logic.dll b/Maze-WPF/Logic/obj/Debug/net7.0/ref/Logic.dll new file mode 100644 index 0000000..b4b8ea3 Binary files /dev/null and b/Maze-WPF/Logic/obj/Debug/net7.0/ref/Logic.dll differ diff --git a/Maze-WPF/Logic/obj/Debug/net7.0/refint/Logic.dll b/Maze-WPF/Logic/obj/Debug/net7.0/refint/Logic.dll new file mode 100644 index 0000000..b4b8ea3 Binary files /dev/null and b/Maze-WPF/Logic/obj/Debug/net7.0/refint/Logic.dll differ diff --git a/Maze-WPF/Logic/obj/Logic.csproj.nuget.dgspec.json b/Maze-WPF/Logic/obj/Logic.csproj.nuget.dgspec.json new file mode 100644 index 0000000..98bb08c --- /dev/null +++ b/Maze-WPF/Logic/obj/Logic.csproj.nuget.dgspec.json @@ -0,0 +1,122 @@ +{ + "format": 1, + "restore": { + "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logic\\Logic.csproj": {} + }, + "projects": { + "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logica\\Global.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logica\\Global.csproj", + "projectName": "Global", + "projectPath": "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logica\\Global.csproj", + "packagesPath": "C:\\Users\\ruben\\.nuget\\packages\\", + "outputPath": "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logica\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\ruben\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net7.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net7.0": { + "targetAlias": "net7.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net7.0": { + "targetAlias": "net7.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.201\\RuntimeIdentifierGraph.json" + } + } + }, + "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logic\\Logic.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logic\\Logic.csproj", + "projectName": "Logic", + "projectPath": "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logic\\Logic.csproj", + "packagesPath": "C:\\Users\\ruben\\.nuget\\packages\\", + "outputPath": "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logic\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\ruben\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net7.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net7.0": { + "targetAlias": "net7.0", + "projectReferences": { + "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logica\\Global.csproj": { + "projectPath": "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logica\\Global.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net7.0": { + "targetAlias": "net7.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.201\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/Maze-WPF/Logic/obj/Logic.csproj.nuget.g.props b/Maze-WPF/Logic/obj/Logic.csproj.nuget.g.props new file mode 100644 index 0000000..8b1ca55 --- /dev/null +++ b/Maze-WPF/Logic/obj/Logic.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\ruben\.nuget\packages\ + PackageReference + 6.5.0 + + + + + \ No newline at end of file diff --git a/Maze-WPF/Logic/obj/Logic.csproj.nuget.g.targets b/Maze-WPF/Logic/obj/Logic.csproj.nuget.g.targets new file mode 100644 index 0000000..35a7576 --- /dev/null +++ b/Maze-WPF/Logic/obj/Logic.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Maze-WPF/Logic/obj/project.assets.json b/Maze-WPF/Logic/obj/project.assets.json new file mode 100644 index 0000000..73fc262 --- /dev/null +++ b/Maze-WPF/Logic/obj/project.assets.json @@ -0,0 +1,91 @@ +{ + "version": 3, + "targets": { + "net7.0": { + "Global/1.0.0": { + "type": "project", + "framework": ".NETCoreApp,Version=v7.0", + "compile": { + "bin/placeholder/Global.dll": {} + }, + "runtime": { + "bin/placeholder/Global.dll": {} + } + } + } + }, + "libraries": { + "Global/1.0.0": { + "type": "project", + "path": "../Logica/Global.csproj", + "msbuildProject": "../Logica/Global.csproj" + } + }, + "projectFileDependencyGroups": { + "net7.0": [ + "Global >= 1.0.0" + ] + }, + "packageFolders": { + "C:\\Users\\ruben\\.nuget\\packages\\": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logic\\Logic.csproj", + "projectName": "Logic", + "projectPath": "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logic\\Logic.csproj", + "packagesPath": "C:\\Users\\ruben\\.nuget\\packages\\", + "outputPath": "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logic\\obj\\", + "projectStyle": "PackageReference", + "configFilePaths": [ + "C:\\Users\\ruben\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net7.0" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net7.0": { + "targetAlias": "net7.0", + "projectReferences": { + "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logica\\Global.csproj": { + "projectPath": "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logica\\Global.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net7.0": { + "targetAlias": "net7.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.201\\RuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/Maze-WPF/Logic/obj/project.nuget.cache b/Maze-WPF/Logic/obj/project.nuget.cache new file mode 100644 index 0000000..8509a03 --- /dev/null +++ b/Maze-WPF/Logic/obj/project.nuget.cache @@ -0,0 +1,8 @@ +{ + "version": 2, + "dgSpecHash": "lnsbpXwor5nRCr6Tm3wWDBsSBG3WZotKkmmojwVOQjrBQQyCkrRNjzOAE7kYTdFtA0vMNVACSunO5a8ZDrgffA==", + "success": true, + "projectFilePath": "C:\\Users\\ruben\\source\\repos\\2324-ap-rubenschoonbaert\\Doolhof\\Logic\\Logic.csproj", + "expectedPackageFiles": [], + "logs": [] +} \ No newline at end of file