Members
(constant) GameTableProvider
Manages the game table state, including player data updates and table data.
Provides functions to access game information and player data.
(constant) Middleware
Paramètres de session
- Source:
REFRESH
_______________________________________
Actions to send informations to player
_______________________________________
(constant) SET_SELECTED_ITEM
Defines action types for window-related actions.
(constant) SettingsProvider
SettingsProvider is a component that provides settings state and dispatcher methods
to its child components via a React context.
(constant) WindowProvider
Manages window state and actions related to windows, such as opening, closing, and setting window types.
Provides functions to interact with the window state and perform window-related actions.
(constant) activateBonus
Creates an action to activate a bonus.
(constant) bet
Creates an action to place a bet.
(constant) check
Creates an action to check.
(constant) comm
Fonction de test de communication entre le front et le back
Le front envoie un Hello avec des données et le back le log
Puis le back envoie des données et le front le log.
- Source:
(constant) corsSettings
Paramètres cors du serveur.
origin -> Fixer sur le front-end. Il n'y a que le serveur front end avec qui la communication est autoriser.
- Source:
(constant) countByValue
Counts occurrences of each card value in a set of cards.
(constant) createGame
Creates an action to create a game.
Includes possible arguments for game creation such as rules, game description, name, etc.
(constant) createGameV2
Creates an action to create a game with a specific room ID.
(constant) emptyPayload
Creates an action with an empty payload.
(constant) fold
Creates an action to fold.
(constant) gameLobby
Creates an action for the game lobby.
(constant) getPokerHand
Evaluates the highest poker hand possible from a set of cards.
(constant) hideCard
Creates an action to hide a card.
(constant) isFlush
Determines if a set of cards contains a flush.
(constant) isFourOfAKind
Determines if a set of cards contains four of a kind.
(constant) isFullHouse
Determines if a set of cards contains a full house.
(constant) isPair
Determines if a set of cards contains a pair.
(constant) isStraight
Determines if a set of cards contains a straight.
(constant) isStraightFlush
Determines if a set of cards contains a straight flush.
(constant) isThreeOfAKind
Determines if a set of cards contains three of a kind.
(constant) isTwoPairs
Determines if a set of cards contains two pairs.
(constant) joinRoom
Creates an action to join a room.
(constant) leaveRoom
Creates an action to leave the current room.
(constant) loggedIn
Creates an action indicating a user has logged in.
(constant) logsocket
Settings for output in the console.
- Source:
(constant) showCard
Creates an action to show a card.
(constant) sitted
Creates an action indicating players are sitted at a table.
(constant) startGame
Creates an action to start the game.
(constant) useItems
useItems is a custom hook that fetches and organizes items into categories based on ownership.
It structures items into 'owned' and 'unowned' for different item categories.
(constant) useUserData
Manages user data, including statistics and user-specific information.
Provides functions to load and update user statistics.
(constant) validateCode
Validates a verification code.
(constant) validateEmail
Validates an email address.
(constant) validatePassword
Validates a password.
(constant) validatePasswordMatch
Validates if two passwords match.
(constant) validatePasswordOrNull
Validates a password or allows it to be null.
(constant) validateUsername
Validates a username.
Methods
AcceuilWindow()
AcceuilWindow component serves as the home screen for users to start or join games.
It provides different functionalities based on the user's authentication status.
AlertWindow()
AlertWindow provides a modal window to handle user confirmations or cancellations.
It uses alert parameters from the window context to display messages and execute actions.
AvatarDisplay()
AvatarDisplay is a component that displays the user's avatar based on the userId prop.
It fetches avatar data either for the specified userId or the logged-in user, and
displays elements like base avatar, sunglasses, and a background color.
Props:
- userId: String or Number representing the ID of the user whose avatar should be displayed.
BonusPanel()
BonusPanel displays a UI panel for activating game bonuses
based on the number of various card symbols collected.
Props:
- nbHearts: Number of heart cards collected.
- nbDiamonds: Number of diamond cards collected.
- nbSpades: Number of spade cards collected.
- nbClubs: Number of club cards collected.
BuyCoinsWindow()
BuyCoinsWindow provides a user interface for purchasing virtual coins.
It displays various purchasing options and handles the purchase transactions.
Card()
Card displays a playing card that can be flipped between its front and back.
It supports dynamic theming and card content based on provided props.
Props:
- card: Array representing the card data, with the first element as the number or face ('A', 'J', 'Q', 'K')
and the second element as the suit ('H', 'D', 'C', 'S').
- styleClass: String representing the additional CSS class for styling the card container.
- flippingCard: Boolean to control if the card should show the flip animation.
- flippedStyle: String for additional CSS class when the card is flipped.
CardsPlacements()
CardsPlacements manages the display and animation of community cards and
transition animations for player cards during a game.
CreateGameWindow()
Provides a UI for users to create a new game room or join an existing one,
including server name input, optional password, and rank selection.
DynamicBar()
DynamicBar displays a dynamic UI based on the context of user interactions and game state.
It features user coins, game controls, and server status based on various conditions from context providers.
ForgotPassword()
ForgotPassword provides a form for users to request a password reset link via email.
It validates user input and displays appropriate feedback messages.
GameActionButtons()
GameActionButtons provides an interface for user actions in a game context,
such as betting, raising, checking, calling, and folding.
GameTable()
Represents the main component for the game table.
Manages the display of game elements and interactions with user settings and game state.
- Source:
HandCards()
HandCards displays the player's hand in a poker game and allows the user to toggle visibility of each card.
It also evaluates the current hand based on community cards and updates the hand guide accordingly.
Props:
- card1: Object representing the first card.
- card2: Object representing the second card.
- showHandCardProp: Boolean to control the card flipping animation.
ListTableItem(props)
ListTableItem component displays a single row in a list of game tables,
providing options to join open or password-protected tables.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
Object | The component props.
Properties
|
LoadingWindow()
LoadingWindow component handles the loading state while a player is waiting to join a game.
It listens for changes in the `playerSited` state from the Redux store to transition the UI.
LoginWindow()
LoginWindow provides a user interface for logging into the application.
It handles user input for username and password, validates them, and processes the login.
LogoComponent()
LogoComponent displays a logo, optionally with a label and animation.
It supports interactive behavior with an onClick handler.
Props:
- styleClass: String specifying additional CSS classes for the logo container.
- onClick: Function to handle click events on the logo.
- label: String (optional) to display a label next to the logo.
- loading: Boolean indicating if a loading animation should be shown.
- Source:
Navbar()
Navbar provides a dynamic navigation bar based on game and user session state.
It handles actions like logging out, leaving rooms, opening various windows, etc.
PlayersPlacements()
PlayersPlacements manages the display of player profiles and pots on the game table.
It listens for updates to the players in the game and renders each player's profile.
Props:
- showMiddle: Boolean to control the visibility of the middle section (usually pots in the game).
PlayersPots()
PlayersPots displays the current betting amount (pot) for each player in a game.
It conditionally renders these amounts based on the visibility prop.
Props:
- players: Array of player objects, each containing betting information.
- isVisible: Boolean that controls the visibility of the component.
PlayersProfile()
PlayersProfile displays individual player information including status, chips count,
name, cards, and also a progress bar when it's the player's turn to act.
Props:
- status: String indicating the player's game status (e.g., 'active', 'folded').
- chips: Number indicating the amount of chips the player has.
- name: String representing the player's name.
- cards: Array of card objects the player holds.
- flippingPlayerCards: Boolean to control card flip animations.
- gotCards: Boolean indicating if the player has cards.
- playerId: Unique identifier for the player.
- cardsVisible: Array of booleans indicating visibility of each card.
- isFocus: Boolean indicating if it is the player's turn.
- isYou: Boolean to specify if the profile is of the user themselves.
- timer: Number representing the countdown time for player's action.
ProfileWindow()
ProfileWindow component displays the user's profile information,
including their avatar, name, email, coin balance, and account creation date.
RankingWindow()
RankingWindow component fetches and displays a paginated list of user rankings,
including their rank, username (pseudo), and coin balance (SC).
ResetPasswordWindow()
ResetPasswordWindow provides a form for users to reset their password.
It includes validation for code, new password, and password confirmation.
ServerPanelWindow()
ServerPanelWindow component manages the display of available game rooms,
including pagination, search functionality, and the ability to join rooms.
SettingsWindow()
SettingsWindow component provides a UI for the user to manage their settings
including theme, sound, animations, and language preferences.
ShopItem(item, onClickItem, isOwned, isActive, styleClass)
ShopItem displays a single item in the shop, handling different item types and states.
Parameters:
| Name | Type | Description |
|---|---|---|
item |
Object | The item data. |
onClickItem |
function | Handler for when the item is clicked. |
isOwned |
boolean | Indicates if the item is already owned by the user. |
isActive |
boolean | Indicates if the item is currently active. |
styleClass |
string | Additional CSS class for styling. |
ShopWindow()
ShopWindow component provides a user interface for browsing and activating various avatars and accessories.
SignUpWindow()
SignUpWindow provides a user interface for registering a new account.
It includes form fields for user information and performs client-side validation.
SuccessWindow()
SuccessWindow component displays a success message to the user.
The message is translated based on the current language settings.
Table()
The Table component serves as the primary UI container for the game,
including players' placements, cards, and other game-related information
based on the visibility state controlled through window context.
- Source:
TextGlitch()
TextGlitch applies a glitch effect to text based on the animation settings.
It allows the text content and glitch styling to be dynamically adjusted via props.
Props:
- children: The text content to apply the glitch effect to.
- styleClass: Additional CSS class for custom styling.
- glitchStyle: Specific glitch effect style class to apply when animations are enabled.
TextInputComponent()
TextInputComponent creates a styled input field with optional error handling.
It uses a translation hook for localized placeholders and error messages.
Props:
- name: String representing the input's name attribute.
- placeholder: String identifier for translation of the input's placeholder text.
- type: String specifying the HTML input type, defaulting to "text".
- value: Controlled value of the input.
- onChange: Function to handle changes in the input.
- errorMessage: String identifier for the error message translation.
- styleClass: CSS class for styling the input element.
- styleClass2: Additional CSS class for the outer container.
- onKeyDown: Function to handle the 'onKeyDown' event.
TotalPot()
TotalPot displays the total amount of chips currently in the game's pot.
It fetches the total pot value from the game context and displays it in a formatted manner.
ValidationWindow()
ValidationWindow provides a UI for confirming item purchases.
It displays the item to be purchased and handles the confirmation process.
WaitingWindow()
WaitingWindow component displays a waiting screen for players before the game starts.
If the user is the master, they have the option to start the game.
The component also displays a message when it is the player's turn to act.
Window()
The Window component acts as a container for various modal windows in the application.
It renders different content based on the current window type from the context.
delayedExecution(fn, delay) → {function}
Creates a delayed version of the given function that will only execute
after the specified delay in milliseconds.
Parameters:
| Name | Type | Description |
|---|---|---|
fn |
function | The function to delay. |
delay |
number | The time to delay in milliseconds. |
- Source:
Returns:
A new function that delays the execution of `fn`.
- Type
- function
delayedExecutionWithCancel(fn, delay) → {Object}
Creates a delayed version of the given function with cancellation capability.
Parameters:
| Name | Type | Description |
|---|---|---|
fn |
function | The function to delay. |
delay |
number | The time to delay in milliseconds. |
Returns:
An object containing the delayed function and a cancel method.
- Type
- Object
(async) emptyGameDesc()
Remove all the gameDescription from the database.
- Source:
formatNumber(value) → {string|number}
Formats a numeric value as a localized string.
This function attempts to format a number using the `toLocaleString` method,
which converts the number to a more readable format according to the local convention.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number | The number to be formatted. |
Returns:
A localized string representation of the number or 0 in case of an error.
- Type
- string | number
getStyles(windowType, isLogged, isGameTableVisible, isWindowOpen, showWaitingMessage, isSpectator) → {object}
Generates styles based on window state and other parameters.
Parameters:
| Name | Type | Description |
|---|---|---|
windowType |
string | The type of window. |
isLogged |
boolean | Indicates whether the user is logged in. |
isGameTableVisible |
boolean | Indicates whether the game table is visible. |
isWindowOpen |
boolean | Indicates whether any window is open. |
showWaitingMessage |
boolean | Indicates whether a waiting message should be shown. |
isSpectator |
boolean | Indicates whether the user is a spectator. |
Returns:
An object containing CSS classes for different components based on the provided parameters.
- Type
- object
(async) resetPlayerInGame()
Reset the status inGame of all the players.
- Source:
(async) sendVerificationEmail(email, code)
Sends a verification email to the specified email address with the provided verification code.
Parameters:
| Name | Type | Description |
|---|---|---|
email |
string | The recipient's email address |
code |
string | The verification code to be sent |
- Source:
useAudio(urlLight, urlDark, theme, play, volume, loop)
Custom hook to manage audio playback based on the theme and sound settings.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
urlLight |
string | The URL of the audio file for the light theme. | |
urlDark |
string | The URL of the audio file for the dark theme. | |
theme |
string | Current theme setting ('light' or 'dark'). | |
play |
boolean | Whether the audio should be played or paused. | |
volume |
number | Volume level (0.0 to 1.0). | |
loop |
boolean | true | Whether the audio should loop. |
- Source:
useOnClickOutside(ref, handler)
Custom hook that triggers a handler when a click occurs outside the specified element.
Parameters:
| Name | Type | Description |
|---|---|---|
ref |
Object | The ref of the element to detect outside clicks for. |
handler |
function | The function to call when an outside click is detected. |
- Source:
useTranslation() → {Object}
Custom hook to provide translated strings based on the current application language.
Falls back to English if the translation in the selected language is not available.
Returns:
Object containing a single function `getTranslatedWord` to fetch a translated string.
- Type
- Object