diff --git a/src/app/(game)/game/_components/Actions/ActionsSection.tsx b/src/app/(game)/game/_components/Actions/ActionsSection.tsx new file mode 100644 index 0000000..0b94153 --- /dev/null +++ b/src/app/(game)/game/_components/Actions/ActionsSection.tsx @@ -0,0 +1,118 @@ +import type { FC } from 'react'; +import { Player } from '@/types/player'; +import RollDiceAction from './RollDiceAction'; +import BuyFieldAction from './BuyFieldAction'; +import PayRentAction from './PayRentAction'; +import VDNHAction from './VDNHAction'; +import CoinAction from './CoinAction'; +import SecretPayAction from './SecretPayAction'; +import { Action } from '@/types'; +import { Field } from '@/types/field'; +import { useAppSelector } from '@/hooks/store'; +import { ACTION_TITLES } from '../../_utils/constants'; +import { api } from '@/api/build/api'; + +interface Props { + action: Action; + currentField: Field; + secretInfo: { + users: string[]; + amounts: number[]; + }; + amountToPay: number; +} + +const ActionsSection: FC = ({ + action, + currentField, + secretInfo, + amountToPay, +}) => { + let renderJsx = null; + + const game = useAppSelector(state => state.game.game); + const { data: user } = useAppSelector(state => state.user); + + const payForSecret = () => { + if (secretInfo.users.length > 2 && secretInfo.amounts[0] === null) { + api.payToUserForSecret(); + } else { + api.payToBankForSecret(); + } + }; + + switch (action) { + case 'rollDice': + renderJsx = api.rollDice()} />; + break; + + case 'buy': + if (!currentField.ownedBy) { + renderJsx = ( + api.buyField()} + onPutUpForAuction={() => api.putUpForAuction()} + /> + ); + } + if (currentField.ownedBy && currentField.ownedBy !== user?.id) { + renderJsx = ( + api.payForPrivateField()} + /> + ); + } + break; + + case 'payForPrivateField': + renderJsx = ( + api.payForPrivateField()} + /> + ); + break; + + case 'VDNH': + renderJsx = ( + api.payToBankForSpecialField()} + /> + ); + break; + + case 'COIN': + renderJsx = ( + api.payToBankForSpecialField()} + /> + ); + break; + + case 'secretPay': + renderJsx = ( + payForSecret()} + /> + ); + break; + } + console.log('renderJsx', renderJsx); + return ( +
+
+ {ACTION_TITLES[action as keyof typeof ACTION_TITLES]} +
+ {renderJsx} +
+ ); +}; + +export default ActionsSection; diff --git a/src/app/(game)/game/_components/Actions/BuyFieldAction.tsx b/src/app/(game)/game/_components/Actions/BuyFieldAction.tsx new file mode 100644 index 0000000..2d8496c --- /dev/null +++ b/src/app/(game)/game/_components/Actions/BuyFieldAction.tsx @@ -0,0 +1,58 @@ +import { Button } from '@/components/ui/button'; +import useScreenSize from '@/hooks/screenSize'; +import HintBulb from '../HintBulb'; + +interface BuyFieldActionProps { + fieldPrice: number; + onBuyField: () => void; + onPutUpForAuction: () => void; +} + +const BuyFieldAction = ({ + fieldPrice, + onBuyField, + onPutUpForAuction, +}: BuyFieldActionProps) => { + const screenSize = useScreenSize(); + + return ( + <> +
+
+
+ +
+
+

+ If you cancel the purchase, the field will be put up for auction. +

+
+
+ +
+ +
+
+ + ); +}; + +export default BuyFieldAction; diff --git a/src/app/(game)/game/_components/Actions/CoinAction.tsx b/src/app/(game)/game/_components/Actions/CoinAction.tsx new file mode 100644 index 0000000..3a51e52 --- /dev/null +++ b/src/app/(game)/game/_components/Actions/CoinAction.tsx @@ -0,0 +1,32 @@ +import { Button } from '@/components/ui/button'; +import useScreenSize from '@/hooks/screenSize'; + +interface CoinActionProps { + amountToPay: number; + onPay: () => void; +} + +const CoinAction = ({ amountToPay, onPay }: CoinActionProps) => { + const screenSize = useScreenSize(); + + return ( + <> +
+

+ The state has decided that you live too luxuriously! Pay + your taxes and maintain the balance in the game. +

+
+ + + ); +}; + +export default CoinAction; diff --git a/src/app/(game)/game/_components/Actions/PayRentAction.tsx b/src/app/(game)/game/_components/Actions/PayRentAction.tsx new file mode 100644 index 0000000..e0afc6a --- /dev/null +++ b/src/app/(game)/game/_components/Actions/PayRentAction.tsx @@ -0,0 +1,32 @@ +import { Button } from '@/components/ui/button'; +import useScreenSize from '@/hooks/screenSize'; + +interface PayRentActionProps { + rentAmount: number; + onPayRent: () => void; +} + +const PayRentAction = ({ rentAmount, onPayRent }: PayRentActionProps) => { + const screenSize = useScreenSize(); + + return ( + <> +
+

+ When you enter someone else's field, you are obliged to + pay the owner a rent according to the value of this field. +

+
+ + + ); +}; + +export default PayRentAction; diff --git a/src/app/(game)/game/_components/Actions/RollDiceAction.tsx b/src/app/(game)/game/_components/Actions/RollDiceAction.tsx new file mode 100644 index 0000000..544fefe --- /dev/null +++ b/src/app/(game)/game/_components/Actions/RollDiceAction.tsx @@ -0,0 +1,38 @@ +import { Button } from '@/components/ui/button'; +import useScreenSize from '@/hooks/screenSize'; +import HintBulb from '../HintBulb'; + +interface RollDiceActionProps { + onRollDice: () => void; +} + +const RollDiceAction = ({ onRollDice }: RollDiceActionProps) => { + const screenSize = useScreenSize(); + + return ( + <> +
+
+
+ +
+

Tip

+
+

+ Remember: sometimes it's better to save money than to + spend it on everything that happens. +

+
+ + + ); +}; + +export default RollDiceAction; diff --git a/src/app/(game)/game/_components/Actions/SecretPayAction.tsx b/src/app/(game)/game/_components/Actions/SecretPayAction.tsx new file mode 100644 index 0000000..9521efe --- /dev/null +++ b/src/app/(game)/game/_components/Actions/SecretPayAction.tsx @@ -0,0 +1,51 @@ +import { Button } from '@/components/ui/button'; +import useScreenSize from '@/hooks/screenSize'; +import { Player } from '@/types/player'; + +interface SecretPayActionProps { + secretInfo: { + users: string[]; + amounts: number[]; + }; + amountToPay: number; + gamePlayers: Player[]; + onPay: () => void; +} + +const SecretPayAction = ({ + secretInfo, + amountToPay, + gamePlayers, + onPay, +}: SecretPayActionProps) => { + const screenSize = useScreenSize(); + + const getSecretMessage = () => { + if (secretInfo.users.length === 1) { + return `The unknown demands sacrifices! You have entered a secret field and must make a payment.`; + } else { + const player = gamePlayers.find( + player => player.userId === secretInfo?.users[0], + ); + return `Player ${player?.user.nickname} activated a secret field, and this led to an event that affected you.`; + } + }; + + return ( + <> +
+

{getSecretMessage()}

+
+ + + ); +}; + +export default SecretPayAction; diff --git a/src/app/(game)/game/_components/Actions/VDNHAction.tsx b/src/app/(game)/game/_components/Actions/VDNHAction.tsx new file mode 100644 index 0000000..e75aa72 --- /dev/null +++ b/src/app/(game)/game/_components/Actions/VDNHAction.tsx @@ -0,0 +1,32 @@ +import { Button } from '@/components/ui/button'; +import useScreenSize from '@/hooks/screenSize'; + +interface VDNHActionProps { + amountToPay: number; + onPay: () => void; +} + +const VDNHAction = ({ amountToPay, onPay }: VDNHActionProps) => { + const screenSize = useScreenSize(); + + return ( + <> +
+

+ You've come to the festival at VDNH! Fairs, attractions + and delicious food - unforgettable impressions guaranteed! +

+
+ + + ); +}; + +export default VDNHAction; diff --git a/src/app/(game)/game/_components/Center.tsx b/src/app/(game)/game/_components/Center.tsx index 297989d..c977c9a 100644 --- a/src/app/(game)/game/_components/Center.tsx +++ b/src/app/(game)/game/_components/Center.tsx @@ -1,214 +1,29 @@ -import { Button } from '@/components/ui/button'; -import useScreenSize from '@/hooks/screenSize'; -import { useAppDispatch, useAppSelector } from '@/hooks/store'; -import { setGame } from '@/store/slices/game'; -import { DataWithGame } from '@/types'; -import { useEffect, useRef, useState } from 'react'; +import { useGameCenterFunctionality } from '../_hooks/useGameCenterFunctionality'; +import ActionsSection from './Actions/ActionsSection'; +import Auction from './Auction/Auction'; import Chat from './Chat/Chat'; -import HintBulb from './HintBulb'; import DicesContainer from './Dice/DicesContainer'; -import Auction from './Auction/Auction'; -import Image from 'next/image'; -import { Avatar } from '@nextui-org/react'; -import { Player } from '@/types/player'; -import Link from 'next/link'; -import { AuctionType } from '@/types/auction'; -import TradeOffer from './Trade/TradeOffer'; import TradeAcceptence from './Trade/TradeAcceptence'; -import { TradeData } from '@/types/trade'; -import { api } from '@/api/build/api'; -type Action = - | 'rollDice' - | 'auction' - | 'buy' - | 'payForPrivateField' - | 'secretPay' - | 'toPay' - | 'VDNH' - | 'COIN' - | ''; +import TradeOffer from './Trade/TradeOffer'; +import WinnerDisplay from './WinnerDisplay'; const Center = () => { - const screenSize = useScreenSize(); - const dispatch = useAppDispatch(); - const fields = useAppSelector(state => state.fields.fields); - const game = useAppSelector(state => state.game.game); - const { data: user } = useAppSelector(state => state.user); - const [action, setAction] = useState( - game.turnOfUserId === user?.id && !game.dices ? 'rollDice' : '', - ); + const { + tradeAcceptance, + setTradeAcceptance, + trade, + turnOfUser, + currentField, + currentPlayer, + chipTransition, + action, + game, + secretInfo, + amountToPay, + auction, + playerWon, + } = useGameCenterFunctionality(); - const { data: chipTransition } = useAppSelector( - state => state.chipTransition, - ); - const { data: trade } = useAppSelector(state => state.trade); - const [tradeAcceptance, setTradeAcceptance] = useState( - null, - ); - const [playerWon, setPlayerWon] = useState(undefined); - const [playerWithTurn] = game.players.filter( - player => player.userId === game.turnOfUserId, - ); - const [currentField] = fields.filter( - field => field.index === playerWithTurn?.currentFieldIndex, - ); - const [secretInfo, setSecretInfo] = useState<{ - users: string[]; - amounts: number[]; - }>({ - users: [], - amounts: [], - }); - const [amountToPay, setAmountToPay] = useState(0); - const rolledDice = useRef(false); - const [auction, setAuction] = useState(null); - - useEffect(() => { - if (rolledDice.current) { - if (!currentField.ownedBy && !currentField.specialField) { - setAction('buy'); - } - if (currentField.ownedBy && currentField.ownedBy !== user?.id) { - setAction('payForPrivateField'); - } - if (currentField.toPay && currentField.name === 'ВДНХ') { - setAction('VDNH'); - } - if (currentField.toPay && currentField.name === 'COIN') { - setAction('COIN'); - } - - if (currentField.secret && secretInfo) { - if (secretInfo.users.length === 1) { - if (secretInfo.amounts[0] < 0) { - setAction('secretPay'); - setAmountToPay(secretInfo.amounts[0]); - } - } else if (secretInfo.users.length === 2) { - const index = secretInfo.users.findIndex( - userId => userId === user?.id, - ); - if (secretInfo.amounts[index] < 0) { - setAction('secretPay'); - setAmountToPay(secretInfo.amounts[index]); - } - } else if ( - secretInfo.users.length > 2 && - user?.id !== secretInfo.users[0] - ) { - if (secretInfo.amounts.length === 2) { - if (secretInfo.amounts[1] < 0) { - setAction('secretPay'); - setAmountToPay(secretInfo.amounts[1]); - } - } - - if (secretInfo.amounts.length === 1) { - if (secretInfo.amounts[0] < 0) { - setAction('secretPay'); - setAmountToPay(secretInfo.amounts[0]); - } - } - } - } - rolledDice.current = false; - } - }, [game]); - useEffect(() => { - const handleRolledDice = (data: any) => { - rolledDice.current = true; - setAction(''); - }; - const handleHasPutUpForAuction = (data: any) => { - setAction('auction'); - setAuction(data.auction); - }; - const handleChangeAuction = (data: any) => { - setAuction(data.auction); - }; - const handleSecret = (data: any) => { - setSecretInfo(data); - }; - const handleUpdatePlayers = (data: any) => { - setSecretInfo(data.secretInfo); - if (!data.secretInfo?.users?.includes(user?.id || 'notIncluded')) - setAction(''); - dispatch(setGame(data.game)); - }; - const handlePassTurnToNext = (data: DataWithGame) => { - if (data.game.turnOfUserId === user?.id) { - setAction('rollDice'); - } else { - setAction(''); - } - }; - const onPlayerWon = (data: any) => { - const playerWon = data.game.players.find( - (player: Player) => !player.lost, - ) as Player | undefined; - - if (playerWon) { - setPlayerWon(playerWon); - } - }; - const handleGameData = (data: any) => { - if (data.auction) { - setAction('auction'); - setAuction(data.auction); - } - if (data.secretInfo) { - setSecretInfo(data); - } - }; - const hadleTradeOffered = (data: any) => { - setTradeAcceptance(data.trade); - }; - api.on.tradeOffered(hadleTradeOffered); - api.on.gameData(handleGameData); - api.on.playerWon(onPlayerWon); - api.on.raisedPrice(handleChangeAuction); - api.on.refusedFromAuction(handleChangeAuction); - api.on.rolledDice(handleRolledDice); - api.on.hasPutUpForAuction(handleHasPutUpForAuction); - api.on.passTurnToNext(handlePassTurnToNext); - api.on.secret(handleSecret); - api.on.updatePlayers(handleUpdatePlayers); - return () => { - api.off.rolledDice(handleRolledDice); - api.off.refusedFromAuction(handleChangeAuction); - api.off.raisedPrice(handleChangeAuction); - api.off.passTurnToNext(handlePassTurnToNext); - api.off.playerWon(onPlayerWon); - api.off.secret(handleSecret); - api.off.updatePlayers(handleUpdatePlayers); - api.off.gameData(handleGameData); - api.off.tradeOffered(hadleTradeOffered); - }; - }, [user]); - const rollDice = () => { - api.rollDice(); - }; - const buyField = () => { - api.buyField(); - }; - const payForPrivateField = () => { - api.payForPrivateField(); - }; - const payToBankForSpecialField = () => { - api.payToBankForSpecialField(); - }; - const payForSecret = () => { - if (secretInfo.users.length > 2 && secretInfo.amounts[0] === null) { - api.payToUserForSecret(); - } else { - api.payToBankForSecret(); - } - }; - const turnOfUser = game.turnOfUserId === user?.id; - const currentPlayer = game.players.find(player => player.userId === user?.id); - const handlePutUpForAuction = () => { - api.putUpForAuction(); - }; return (
{tradeAcceptance && ( @@ -225,183 +40,12 @@ const Center = () => { action && action !== 'auction' && (currentField.ownedBy !== game.turnOfUserId || !game.dices) && ( -
-
- {action === 'rollDice' - ? 'Your turn' - : action === 'buy' - ? 'Buy field?' - : action === 'payForPrivateField' - ? 'Pay for rent' - : action === 'secretPay' - ? 'Unexpected expenses' - : action === 'COIN' - ? 'Luxury tax' - : action === 'VDNH' - ? 'VDNH is a time for fun!' - : ''} -
- {action === 'rollDice' && ( - <> -
-
-
- -
-

Tip

-
-

- Remember: sometimes it's better to save money than to - spend it on everything that happens. -

-
- - - )} - {action === 'buy' && !currentField.ownedBy && ( - <> -
-
-
- -
-
-

- If you cancel the purchase, the field will be put up for - auction. -

-
-
- -
- -
-
- - )} - {action === 'payForPrivateField' && ( - <> -
-

- When you enter someone else's field, you are obliged to - pay the owner a rent according to the value of this field. -

-
- - - )} - {action === 'VDNH' && ( - <> -
-

- You've come to the festival at VDNH! Fairs, attractions - and delicious food - unforgettable impressions guaranteed! -

-
- - - )} - {action === 'COIN' && ( - <> -
-

- The state has decided that you live too luxuriously! Pay - your taxes and maintain the balance in the game. -

-
- - - )} - {action === 'secretPay' && ( - <> -
-

- {secretInfo && - (secretInfo.users.length === 1 - ? `The unknown demands sacrifices! You have entered a secret field and must make a payment.` - : `Player ${game.players.find(player => player.userId === secretInfo?.users[0])?.user.nickname} activated a secret field, and this led to an event that affected you.`)} -

-
- - - )} - {action === 'buy' && - currentField.ownedBy && - currentField.ownedBy !== user?.id && ( - <> -
-

- When you enter someone else's field, you are obliged to - pay the owner a rent according to the value of this - field. -

-
- - - )} -
+ )}
{ - {playerWon && !chipTransition && ( -
-

- Winner -

- -
-
- back-button - -
-

- {playerWon?.user.nickname} -

-
- - -
- back-button -

- Exit -

-
- -
- )} + {playerWon && !chipTransition && } ); }; diff --git a/src/app/(game)/game/_components/WinnerDisplay.tsx b/src/app/(game)/game/_components/WinnerDisplay.tsx new file mode 100644 index 0000000..7388415 --- /dev/null +++ b/src/app/(game)/game/_components/WinnerDisplay.tsx @@ -0,0 +1,55 @@ +import { Player } from '@/types/player'; +import { Avatar } from '@nextui-org/react'; +import Image from 'next/image'; +import Link from 'next/link'; +import type { FC } from 'react'; + +interface Props { + playerWon: Player; +} + +const WinnerDisplay: FC = ({ playerWon }) => { + return ( +
+

+ Winner +

+ +
+
+ back-button + +
+

+ {playerWon?.user.nickname} +

+
+ + +
+ back-button +

+ Exit +

+
+ +
+ ); +}; + +export default WinnerDisplay; diff --git a/src/app/(game)/game/_hooks/useGameCenterFunctionality.ts b/src/app/(game)/game/_hooks/useGameCenterFunctionality.ts new file mode 100644 index 0000000..c978108 --- /dev/null +++ b/src/app/(game)/game/_hooks/useGameCenterFunctionality.ts @@ -0,0 +1,186 @@ +import { api } from '@/api/build/api'; +import { useAppDispatch, useAppSelector } from '@/hooks/store'; +import { setGame } from '@/store/slices/game'; +import { Action, DataWithGame } from '@/types'; +import { AuctionType } from '@/types/auction'; +import { Player } from '@/types/player'; +import { TradeData } from '@/types/trade'; +import { useEffect, useRef, useState } from 'react'; + +export const useGameCenterFunctionality = () => { + const dispatch = useAppDispatch(); + const fields = useAppSelector(state => state.fields.fields); + const game = useAppSelector(state => state.game.game); + const { data: user } = useAppSelector(state => state.user); + const [action, setAction] = useState( + game.turnOfUserId === user?.id && !game.dices ? 'rollDice' : '', + ); + + const { data: chipTransition } = useAppSelector( + state => state.chipTransition, + ); + const { data: trade } = useAppSelector(state => state.trade); + const [tradeAcceptance, setTradeAcceptance] = useState( + null, + ); + const [playerWon, setPlayerWon] = useState(undefined); + const [playerWithTurn] = game.players.filter( + player => player.userId === game.turnOfUserId, + ); + const [currentField] = fields.filter( + field => field.index === playerWithTurn?.currentFieldIndex, + ); + const [secretInfo, setSecretInfo] = useState<{ + users: string[]; + amounts: number[]; + }>({ + users: [], + amounts: [], + }); + const [amountToPay, setAmountToPay] = useState(0); + const rolledDice = useRef(false); + const [auction, setAuction] = useState(null); + + useEffect(() => { + if (rolledDice.current) { + if (!currentField.ownedBy && !currentField.specialField) { + setAction('buy'); + } + if (currentField.ownedBy && currentField.ownedBy !== user?.id) { + setAction('payForPrivateField'); + } + if (currentField.toPay && currentField.name === 'ВДНХ') { + setAction('VDNH'); + } + if (currentField.toPay && currentField.name === 'COIN') { + setAction('COIN'); + } + + if (currentField.secret && secretInfo) { + if (secretInfo.users.length === 1) { + if (secretInfo.amounts[0] < 0) { + setAction('secretPay'); + setAmountToPay(secretInfo.amounts[0]); + } + } else if (secretInfo.users.length === 2) { + const index = secretInfo.users.findIndex( + userId => userId === user?.id, + ); + if (secretInfo.amounts[index] < 0) { + setAction('secretPay'); + setAmountToPay(secretInfo.amounts[index]); + } + } else if ( + secretInfo.users.length > 2 && + user?.id !== secretInfo.users[0] + ) { + if (secretInfo.amounts.length === 2) { + if (secretInfo.amounts[1] < 0) { + setAction('secretPay'); + setAmountToPay(secretInfo.amounts[1]); + } + } + + if (secretInfo.amounts.length === 1) { + if (secretInfo.amounts[0] < 0) { + setAction('secretPay'); + setAmountToPay(secretInfo.amounts[0]); + } + } + } + } + rolledDice.current = false; + } + }, [game]); + useEffect(() => { + const handleRolledDice = (data: any) => { + rolledDice.current = true; + setAction(''); + }; + const handleHasPutUpForAuction = (data: any) => { + setAction('auction'); + setAuction(data.auction); + }; + const handleChangeAuction = (data: any) => { + setAuction(data.auction); + }; + const handleSecret = (data: any) => { + setSecretInfo(data); + }; + const handleUpdatePlayers = (data: any) => { + setSecretInfo(data.secretInfo); + if (!data?.secretInfo?.users?.includes(user?.id || 'notIncluded')) + setAction(''); + dispatch(setGame(data.game)); + }; + const handlePassTurnToNext = (data: DataWithGame) => { + if (data.game.turnOfUserId === user?.id) { + setAction('rollDice'); + } else { + setAction(''); + } + }; + const onPlayerWon = (data: any) => { + const playerWon = data.game.players.find( + (player: Player) => !player.lost, + ) as Player | undefined; + + if (playerWon) { + setPlayerWon(playerWon); + } + }; + const handleGameData = (data: any) => { + if (data.auction) { + setAction('auction'); + setAuction(data.auction); + } + if (data.secretInfo) { + setSecretInfo(data); + } + }; + const handleTradeOffered = (data: any) => { + setTradeAcceptance(data.trade); + }; + api.on.tradeOffered(handleTradeOffered); + api.on.gameData(handleGameData); + api.on.playerWon(onPlayerWon); + api.on.raisedPrice(handleChangeAuction); + api.on.refusedFromAuction(handleChangeAuction); + api.on.rolledDice(handleRolledDice); + api.on.hasPutUpForAuction(handleHasPutUpForAuction); + api.on.passTurnToNext(handlePassTurnToNext); + api.on.secret(handleSecret); + api.on.updatePlayers(handleUpdatePlayers); + return () => { + api.off.rolledDice(handleRolledDice); + api.off.refusedFromAuction(handleChangeAuction); + api.off.raisedPrice(handleChangeAuction); + api.off.passTurnToNext(handlePassTurnToNext); + api.off.playerWon(onPlayerWon); + api.off.secret(handleSecret); + api.off.updatePlayers(handleUpdatePlayers); + api.off.gameData(handleGameData); + api.off.tradeOffered(handleTradeOffered); + }; + }, [user]); + + const turnOfUser = game.turnOfUserId === user?.id; + const currentPlayer = game.players.find(player => player.userId === user?.id); + + return { + tradeAcceptance, + setTradeAcceptance, + trade, + action, + currentField, + secretInfo, + amountToPay, + playerWon, + game, + user, + chipTransition, + turnOfUser, + auction, + currentPlayer, + }; +}; diff --git a/src/app/(game)/game/_utils/constants.ts b/src/app/(game)/game/_utils/constants.ts new file mode 100644 index 0000000..be88296 --- /dev/null +++ b/src/app/(game)/game/_utils/constants.ts @@ -0,0 +1,8 @@ +export const ACTION_TITLES = { + rollDice: 'Your turn', + buy: 'Buy field?', + payForPrivateField: 'Pay for rent', + secretPay: 'Unexpected expenses', + COIN: 'Luxury tax', + VDNH: 'VDNH is a time for fun!', +} as const; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 4ee6f35..425f852 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -13,7 +13,7 @@ export const metadata: Metadata = { export const viewport: Viewport = { themeColor: [{ media: '(prefers-color-scheme: light)', color: 'white' }], -}; +}; export default function RootLayout({ children, diff --git a/src/types/game.ts b/src/types/game.ts index 01f2fdf..c9fefb7 100644 --- a/src/types/game.ts +++ b/src/types/game.ts @@ -20,6 +20,17 @@ export interface Game { hotelsQty: number; } +export type Action = + | 'rollDice' + | 'auction' + | 'buy' + | 'payForPrivateField' + | 'secretPay' + | 'toPay' + | 'VDNH' + | 'COIN' + | ''; + export interface DataWithGame { game: Game; fields?: Field[];