-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
23 lines (17 loc) · 704 Bytes
/
Program.cs
File metadata and controls
23 lines (17 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using ChessMazeApp.Interfaces;
using ChessMazeApp.Models;
var designer = new LevelDesigner();
ILevel level = designer.CreateLevel(5, 5);
Console.WriteLine($"Created {level.Name}");
var knight = new Piece(PieceType.Knight, new Position(0, 0));
designer.PlacePiece(knight, new Position(0, 0));
Console.WriteLine($"Placed {knight}");
designer.UndoLastAction();
Console.WriteLine("Undo last action -> Knight removed");
designer.SetStartPosition(new Position(0, 0));
designer.SetEndPosition(new Position(4, 4));
Console.WriteLine("Start and End positions set");
if (designer.ValidateLevel(out var error))
Console.WriteLine("Level is valid");
else
Console.WriteLine($"Level invalid: {error}");