Added Backend Classes and FUnctions for an working Game. But lacking Implementations
This commit is contained in:
Generated
-6
@@ -62,7 +62,6 @@
|
||||
"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.29.0",
|
||||
"@babel/generator": "^7.29.0",
|
||||
@@ -1386,7 +1385,6 @@
|
||||
"integrity": "sha512-oH72nZRfDv9lADUBSo104Aq7gPHpQZc4BTx38r9xf9pg5LfP6EzSyH2n7qFmmxRQXh7YlUXODcYsg6PuTDSxGg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"undici-types": "~7.16.0"
|
||||
}
|
||||
@@ -1850,7 +1848,6 @@
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"baseline-browser-mapping": "^2.9.0",
|
||||
"caniuse-lite": "^1.0.30001759",
|
||||
@@ -2977,7 +2974,6 @@
|
||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||
"devOptional": true,
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
@@ -3085,7 +3081,6 @@
|
||||
"integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.27.0",
|
||||
"fdir": "^6.5.0",
|
||||
@@ -3271,7 +3266,6 @@
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-3.5.28.tgz",
|
||||
"integrity": "sha512-BRdrNfeoccSoIZeIhyPBfvWSLFP4q8J3u8Ju8Ug5vu3LdD+yTM13Sg4sKtljxozbnuMu1NB1X5HBHRYUzFocKg==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.5.28",
|
||||
"@vue/compiler-sfc": "3.5.28",
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import type { FieldSize } from '@/scripts/interfaces/FieldSize.ts'
|
||||
import buildFieldArray from '@/scripts/utils/BuildFieldArray'
|
||||
|
||||
class LocalGame {
|
||||
public field: number[][]
|
||||
|
||||
constructor(fieldSize: FieldSize) {
|
||||
this.field = Array.from({ length: fieldSize.y }, () => Array(fieldSize.x).fill(0))
|
||||
this.field = buildFieldArray(fieldSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ import * as signalR from '@microsoft/signalr';
|
||||
|
||||
class GameConnection{
|
||||
public connection: signalR.HubConnection
|
||||
constructor(gameSession: string) {
|
||||
constructor(playerName: string, joinCode: number | undefined) {
|
||||
this.connection = new signalR.HubConnectionBuilder()
|
||||
.withUrl(`/gameHub?gameSession=${gameSession}`)
|
||||
.withUrl("/api/gamehub")
|
||||
.withAutomaticReconnect()
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { FieldSize } from "../interfaces/FieldSize";
|
||||
|
||||
function buildFieldArray(fieldSize: FieldSize): number[][]{
|
||||
return Array.from({ length: fieldSize.y }, () => Array(fieldSize.x).fill(0));
|
||||
}
|
||||
|
||||
export default buildFieldArray;
|
||||
Reference in New Issue
Block a user