diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-11 20:53:17 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-11 20:53:17 +0900 |
| commit | fe8b14ccc77c829a2baa4034edb22daff9d5d8f8 (patch) | |
| tree | 37528798ede5a89b1a7be6c6ee2fec20395668a2 /frontend/app/components/GolfPlayApp.client.tsx | |
| parent | e3502d9e649fe61bb0ba4046b2c23c0d78bc92e9 (diff) | |
| parent | 0c448f5d403a084389acb0b3d215f8728a599302 (diff) | |
| download | iosdc-japan-2024-albatross-fe8b14ccc77c829a2baa4034edb22daff9d5d8f8.tar.gz iosdc-japan-2024-albatross-fe8b14ccc77c829a2baa4034edb22daff9d5d8f8.tar.zst iosdc-japan-2024-albatross-fe8b14ccc77c829a2baa4034edb22daff9d5d8f8.zip | |
Merge branch 'feat/send-problem-before-starting-game'
Diffstat (limited to 'frontend/app/components/GolfPlayApp.client.tsx')
| -rw-r--r-- | frontend/app/components/GolfPlayApp.client.tsx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/frontend/app/components/GolfPlayApp.client.tsx b/frontend/app/components/GolfPlayApp.client.tsx index 43828e6..70c463f 100644 --- a/frontend/app/components/GolfPlayApp.client.tsx +++ b/frontend/app/components/GolfPlayApp.client.tsx @@ -11,7 +11,6 @@ import GolfPlayAppWaiting from "./GolfPlayApps/GolfPlayAppWaiting"; type WebSocketMessage = components["schemas"]["GamePlayerMessageS2C"]; type Game = components["schemas"]["Game"]; -type Problem = components["schemas"]["Problem"]; type GameState = "connecting" | "waiting" | "starting" | "gaming" | "finished"; @@ -32,8 +31,6 @@ export default function GolfPlayApp({ const [gameState, setGameState] = useState<GameState>("connecting"); - const [problem, setProblem] = useState<Problem | null>(null); - const [startedAt, setStartedAt] = useState<number | null>(null); const [timeLeftSeconds, setTimeLeftSeconds] = useState<number | null>(null); @@ -105,8 +102,6 @@ export default function GolfPlayApp({ if (lastJsonMessage !== null) { console.log(lastJsonMessage.type); if (lastJsonMessage.type === "player:s2c:prepare") { - const { problem } = lastJsonMessage.data; - setProblem(problem); console.log("player:c2s:ready"); sendJsonMessage({ type: "player:c2s:ready" }); } else if (lastJsonMessage.type === "player:s2c:start") { @@ -148,7 +143,8 @@ export default function GolfPlayApp({ } else if (gameState === "gaming") { return ( <GolfPlayAppGaming - problem={problem!.description} + problemTitle={game.problem.title} + problemDescription={game.problem.description} onCodeChange={onCodeChange} onCodeSubmit={onCodeSubmit} currentScore={currentScore} |
