Commit Graph

25 Commits

Author SHA1 Message Date
jonas 466c1c387d Add game join UI and OnlineGame scaffold
Rename JoinMenu to GameJoinMenu and add a JoinGameObject model + OTP input for entering a 6-digit game code. Introduce a new JoinGameObject interface file. Update OnlineMode.vue to import and render GameJoinMenu and GameEndedMenu, add refs for joiningModel, game, gameField, currentSelectionIndex and gameEndedInformation, wire create/ join handlers (stubbed) and the main game view (Field and InfoField). Refactor LocalGame to OnlineGame, export it as default and add a stubbed drop method; adjust import path formatting. Several functions remain as stubs to be implemented in follow-up commits.
2026-03-12 23:20:05 +01:00
jonas a5019fc27a Add JoinMenu and join error handling
Add a new JoinMenu.vue component to provide a UI for joining existing games (emits a "join" event and offers Cancel/Join buttons). Improve UX by adding spacing to GameCreationMenu.vue header. Update OnlineMode.vue to import GameCreationMenu. In the API, send a client-side error message when adding a player fails (GameManager.cs now notifies the player's connection with "Spiel Existiert nicht!" before returning null) so users receive immediate feedback when a join attempt is invalid.
2026-03-12 23:20:05 +01:00
jonas 357449025a Add online UI components and guard fix
Introduce Online mode UI and supporting logic, plus small UI/layout refinements and a backend guard fix.

- Add CreateOrJoinMenu component for choosing between creating or joining an online game.
- Add OnlineGame class (stub) to manage online-game connection callbacks.
- Update OnlineMode route to drive Create/Join flow and start creation state.
- Refactor GameCreationMenu and GameEndedMenu layout to center content and adjust spacing/emit names.
- Update LocalMode to use the refactored components for creating and end screens.
- Minor text tweak in LocalGame description.
- Fix GameManager guard to prevent processing player moves when the game is not in Running state (check current turn and game state before proceeding).

These changes wire up the initial online UI flow and tighten server-side validation to avoid processing moves outside a running game.
2026-03-12 23:20:05 +01:00
jonas ae12be042d Bump Rollup to v4.59.0 in GUI lockfile
Update GUI/package-lock.json to upgrade rollup from 4.57.1 to 4.59.0. This updates the top-level rollup dev dependency and its many platform-specific optional packages (version, resolved URLs, and integrity hashes). Lockfile-only change from running npm install; no source code modifications.
2026-03-12 23:20:05 +01:00
Jonas c18ed5954e Add OnlineMode route and extract app styles
Introduce an OnlineMode route and placeholder component, wire it into the router and Home menu (replace the removed local-vs-bot entry). Rename utils/index.ts to router/index.ts and add the new /onlineMode route; update main.ts to import the router from ./router and include the new app.css. Extract shared #game and .game-content styles into GUI/src/app.css and remove the duplicate styles from LocalMode.vue. Make small UI tweaks: adjust GameEndedMenu width, minor formatting/attribute fixes in Layout.vue and LocalMode.vue.
2026-03-12 23:20:05 +01:00
Jonas bb3c482728 Add game restart and disconnect support
Prevent handling disconnects for games already ended; add a disconnect() method on the SignalR connection and a LocalGame.disconnectAll() helper. Update GameEndedMenu to emit a restart event and adjust displayed messages/labels. Wire a restart() handler in LocalMode that disconnects all players then restarts the game.
2026-03-12 23:20:05 +01:00
jhim 919bb71f19 Game Logic in Frontend 2026-03-12 23:20:05 +01:00
Jonas 34f683854b Use GameInformationDto for FieldUpdated events
Send a GameInformationDto from the GameManager when broadcasting FieldUpdated (includes players, current field, state and current turn) and move currentTurn toggle before the broadcast. Update client code (GameConnection and LocalGame) to accept GameInformationDto for FieldUpdated, rename handler to updateState and apply the full game state payload. This ensures clients receive consistent game metadata (including current turn) with each field update.
2026-03-12 23:20:05 +01:00
Jonas 0eed8020b8 Convert field to jagged arrays; add local SignalR UI
Change game field representation to jagged arrays (int[][]) for JSON/SignalR compatibility and add conversion helpers in GameManager. Make Coordinates JSON-serializable (constructor and JsonPropertyName attributes). Update GameHubSocket: validate field size, fix JoinGame parameter order/Group join, rename Place->Drop and send proper game id. Add client-side local play support: GameConnection SignalR client, LocalGame orchestration for two local players, and UI components (GameCreationMenu, Slider) plus GameSettings interface. Update LocalMode route to use the new creation UI and start local games. These changes enable reliable serialization over SignalR and a local two-player flow with a creation UI.
2026-03-12 23:20:05 +01:00
jhim 5db7ac1676 Added Backend Classes and FUnctions for an working Game. But lacking Implementations 2026-03-12 23:20:05 +01:00
jonas 120c671dce Integrate SignalR for game session management and clean up unused local game logic. 2026-03-12 23:20:05 +01:00
jonas 306dacc300 Update Vite output path and remove redundant wwwroot configuration 2026-03-12 23:20:05 +01:00
jonas afa14d07c6 Remove IDE-specific configuration files and update .gitignore. 2026-03-12 23:20:05 +01:00
jonas 8eefc1a2b8 Configure API to serve SPA, integrate SignalR, and update build paths 2026-03-12 23:20:05 +01:00
jonas f98d9e79b2 Add StatusController, improve local game logic, and enable Swagger in API 2026-03-12 23:20:05 +01:00
jonas 7395b6d3bf Introduce LocalGame logic and integrate with LocalMode rendering. 2026-03-12 23:20:05 +01:00
jonas 13fdf97f5a - Rename and restructure components and assets for uniformity.
- Refactor `Field.vue` for better state management and event handling.
- Update path references for SVG assets.
- Add selection highlighting in game field with red and white arrows.
- Simplify and organize styles in game components.
- Minor updates to local mode game logic (`LocalMode.vue`).
2026-03-12 23:20:05 +01:00
jonas 2337c6b2db "Remove package-lock.json file." 2026-03-12 23:20:05 +01:00
jonas 0e90f70a92 "Remove package-lock.json file." 2026-03-12 23:20:05 +01:00
jhim a8879da715 better design and working setting cells 2026-03-12 23:20:05 +01:00
jhim 8e99bbca0e added a new site and a gamefield component 2026-03-12 23:20:05 +01:00
Jonas 4dfabb2e1e Claude/style homepage om t wo (#1)
* Style homepage with centered title and polished buttons

- Split title into two lines with uppercase styling and yellow highlight
- Use Roboto font with light/bold weight contrast for visual hierarchy
- Center buttons in a vertical flex layout with consistent spacing
- Add elevation shadow and hover scale animation to buttons
- Improve letter-spacing and font sizing for readability

https://claude.ai/code/session_01N9z7ADBGmszE5ZoAbVEp4f

* changed ' to "

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: jhim <jhim@d-velop.de>
2026-03-12 23:20:05 +01:00
jonas da6bb05126 Set app title, update Home, normalize lockfile
Change the app title in GUI/index.html to "4 Gewinnt" to reflect the project name. Apply updates to GUI/src/Home.vue (UI/logic adjustments). Regenerate/normalize GUI/package-lock.json alongside these changes.
2026-03-12 23:20:05 +01:00
jhim 4533bdf179 startseite 2026-03-12 23:20:05 +01:00
jhim 74f9f11b6d init vue and asp.net 2026-03-12 23:20:05 +01:00