SyntaxSquad/DADProject#16 merge: fix merge conflics

This commit is contained in:
AfonsoCMSousa
2026-01-03 00:53:51 +00:00
16 changed files with 2813 additions and 1197 deletions
+24 -23
View File
@@ -1,36 +1,37 @@
import BiscaGame from '../classes/BiscaGame.js';
import BiscaGame from "../classes/BiscaGame.js";
const activeGames = new Map();
const createGame = (id, type, player1, player2) => {
const existingGame = activeGames.get(id);
if (existingGame) {
console.log(
`[Game State] Game ${id} already exists, returning existing instance`,
);
return existingGame;
}
const game = new BiscaGame(id, type, player1, player2);
export const createGame = (id, type, player1, player2) => {
const existingGame = activeGames.get(id);
if (existingGame) {
console.log(
`[Game State] Game ${id} already exists, returning existing instance`
);
return existingGame;
}
const game = new BiscaGame(id, type, player1, player2);
game.init();
game.init();
activeGames.set(id, game);
activeGames.set(id, game);
console.log(`[Game State] Game created: ${id} (Type: ${type})`);
return game;
console.log(`[Game State] Game created: ${id} (Type: ${type})`);
return game;
};
const getGame = (id) => {
return activeGames.get(id);
export const getGame = (id) => {
return activeGames.get(id);
};
const removeGame = (id) => {
const game = activeGames.get(id);
if (game) {
game.stopTimer();
activeGames.delete(id);
console.log(`[Game State] Game removed: ${id}`);
}
export const removeGame = (id) => {
const game = activeGames.get(id);
if (game) {
game.stopTimer();
activeGames.delete(id);
console.log(`[Game State] Game removed: ${id}`);
}
};
export { createGame, getGame, removeGame };
+16
View File
@@ -0,0 +1,16 @@
const matches = new Map();
export const addMatch = (match) => {
matches.set(parseInt(match.id), match);
return match;
};
export const getMatch = (id) => {
return matches.get(parseInt(id));
};
export const removeMatch = (id) => {
matches.delete(parseInt(id));
};
export { matches };