diff --git a/src/App.tsx b/src/App.tsx index bc2edd2..9fccb81 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import { motion } from "framer-motion"; import { useNakama } from "./providers/NakamaProvider"; import Player from "./Player"; -import { PlayerModel } from "./interfaces/models"; +import { Player } from "./interfaces/models"; import TicTacToeBoard from "./games/tictactoe/TicTacToeBoard"; import BattleShipBoard from "./games/battleship/BattleShipBoard"; @@ -13,7 +13,7 @@ export default function App() { const [turn, setTurn] = useState(0); const [winner, setWinner] = useState(null); const [gameOver, setGameOver] = useState(null); - const [players, setPlayers] = useState([]); + const [players, setPlayers] = useState([]); const [metadata, setMetadata] = useState>({}); const { sendMatchData, onMatchData, matchId, session } = useNakama(); diff --git a/src/games/battleship/BattleShipBoard.tsx b/src/games/battleship/BattleShipBoard.tsx index 2d31392..7488d72 100644 --- a/src/games/battleship/BattleShipBoard.tsx +++ b/src/games/battleship/BattleShipBoard.tsx @@ -1,14 +1,14 @@ import React, { useMemo } from "react"; import { motion } from "framer-motion"; import { useNakama } from "../../providers/NakamaProvider"; -import { PlayerModel } from "../../models/player"; +import { Player } from "../../interfaces/models"; import PlacementGrid from "./placement/PlacementGrid"; import ShotGrid from "./battle/ShotGrid"; interface BattleBoardProps { boards: Record; - players: PlayerModel[]; + players: Player[]; myUserId: string | null; turn: number; winner: string | null; diff --git a/src/games/battleship/props.ts b/src/games/battleship/props.ts index 0329f71..69f6d40 100644 --- a/src/games/battleship/props.ts +++ b/src/games/battleship/props.ts @@ -1,6 +1,6 @@ import { Board, - PlayerModel, + Player, } from '../../interfaces/models' @@ -9,7 +9,7 @@ export interface BattleShipBoardProps { turn: number; winner: string | null; gameOver: boolean | null; - players: PlayerModel[]; + players: Player[]; myUserId: string | null; metadata: Record; } diff --git a/src/games/tictactoe/TicTacToeBoard.tsx b/src/games/tictactoe/TicTacToeBoard.tsx index 3f8b4ac..ab1e4d8 100644 --- a/src/games/tictactoe/TicTacToeBoard.tsx +++ b/src/games/tictactoe/TicTacToeBoard.tsx @@ -2,14 +2,14 @@ import React, { useEffect, useState } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { useNakama } from "../../providers/NakamaProvider"; import getHaiku from "../../utils/haikus"; -import { PlayerModel } from "../../models/player"; +import { Player } from "../../interfaces/models"; interface BoardProps { boards: Record; turn: number; winner: string | null; gameOver: boolean | null; - players: PlayerModel[]; + players: Player[]; myUserId: string | null; onCellClick: (row: number, col: number) => void; } diff --git a/src/games/tictactoe/props.ts b/src/games/tictactoe/props.ts index bad6ef9..6475d6b 100644 --- a/src/games/tictactoe/props.ts +++ b/src/games/tictactoe/props.ts @@ -1,6 +1,6 @@ import { Board, - PlayerModel, + Player, } from '../../interfaces/models' @@ -9,7 +9,7 @@ export interface TicTacToeBoardProps { turn: number; winner: string | null; gameOver: boolean | null; - players: PlayerModel[]; + players: Player[]; myUserId: string | null; onCellClick: (row: number, col: number) => void; } diff --git a/src/interfaces/models.ts b/src/interfaces/models.ts index 5da685c..891c5ea 100644 --- a/src/interfaces/models.ts +++ b/src/interfaces/models.ts @@ -1,4 +1,4 @@ -export interface PlayerModel { +export interface Player { user_id: string; username: string; index: number; @@ -20,7 +20,7 @@ export interface GameState { turn: number; winner: string | null; gameOver: boolean; - players: PlayerModel[]; + players: Player[]; metadata: Record; }