diff --git a/.idea/.idea.4Gewinnt/.idea/indexLayout.xml b/.idea/.idea.4Gewinnt/.idea/indexLayout.xml
new file mode 100644
index 0000000..7b08163
--- /dev/null
+++ b/.idea/.idea.4Gewinnt/.idea/indexLayout.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.4Gewinnt/.idea/projectSettingsUpdater.xml b/.idea/.idea.4Gewinnt/.idea/projectSettingsUpdater.xml
new file mode 100644
index 0000000..ef20cb0
--- /dev/null
+++ b/.idea/.idea.4Gewinnt/.idea/projectSettingsUpdater.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.4Gewinnt/.idea/vcs.xml b/.idea/.idea.4Gewinnt/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/.idea.4Gewinnt/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.4Gewinnt/.idea/workspace.xml b/.idea/.idea.4Gewinnt/.idea/workspace.xml
new file mode 100644
index 0000000..bba1e5e
--- /dev/null
+++ b/.idea/.idea.4Gewinnt/.idea/workspace.xml
@@ -0,0 +1,172 @@
+
+
+
+ API/API.csproj
+ API/API.csproj
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ "lastFilter": {
+ "state": "OPEN",
+ "assignee": "kobolol"
+ }
+}
+ {
+ "selectedUrlAndAccountId": {
+ "url": "https://github.com/kobolol/4Gewinnt.git",
+ "accountId": "d9eb72c2-66d7-49fb-af80-9f4d8b4aec2a"
+ }
+}
+
+
+
+
+
+ {
+ "customColor": "",
+ "associatedIndex": 1
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1771600658926
+
+
+ 1771600658926
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/API/API.csproj b/API/API.csproj
index 4a3c7a9..b7f4cae 100644
--- a/API/API.csproj
+++ b/API/API.csproj
@@ -8,10 +8,7 @@
-
-
-
-
+
diff --git a/API/Controllers/StatusController.cs b/API/Controllers/StatusController.cs
new file mode 100644
index 0000000..18b8f67
--- /dev/null
+++ b/API/Controllers/StatusController.cs
@@ -0,0 +1,14 @@
+using Microsoft.AspNetCore.Mvc;
+
+namespace API.Controllers;
+
+[ApiController]
+[Route("[controller]")]
+public class StatusController : ControllerBase
+{
+ [HttpGet]
+ public IActionResult Get()
+ {
+ return Ok("Running");
+ }
+}
diff --git a/API/Program.cs b/API/Program.cs
index 666a9c5..8e67c3f 100644
--- a/API/Program.cs
+++ b/API/Program.cs
@@ -3,8 +3,8 @@ var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
-// Learn more about configuring OpenAPI at https://aka.ms/aspnet/openapi
builder.Services.AddOpenApi();
+builder.Services.AddSwaggerGen();
var app = builder.Build();
@@ -12,6 +12,8 @@ var app = builder.Build();
if (app.Environment.IsDevelopment())
{
app.MapOpenApi();
+ app.UseSwagger();
+ app.UseSwaggerUI();
}
app.UseHttpsRedirection();
diff --git a/GUI/src/scripts/logic/localMode/LocalGame.ts b/GUI/src/scripts/logic/localMode/LocalGame.ts
index 0a61086..9cecf1a 100644
--- a/GUI/src/scripts/logic/localMode/LocalGame.ts
+++ b/GUI/src/scripts/logic/localMode/LocalGame.ts
@@ -8,17 +8,21 @@ class LocalGame {
this.field = Array.from({ length: fieldSize.y }, () => Array(fieldSize.x).fill(0))
}
- place(locationX: number): void {
+ place(locationX: number | null): void {
+ if(locationX === null) return;
+ console.log(
+ `Player ${this.currentPlayer} placed a field at x: ${locationX}`
+ )
for (let y = this.field.length - 1; y >= 0; y--) {
const row = this.field[y]
if (row && row[locationX] === 0) {
row[locationX] = this.currentPlayer
+ this.currentPlayer = this.currentPlayer === 1 ? 2 : 1
break
}
}
- this.currentPlayer = this.currentPlayer === 1 ? 2 : 1
}
}