Skip to main content

Bets

Bets are the simplest type of competitiveness where players bet equal amounts of coins that they can win a match and the winner takes all. Before a match with a bet configured can start, every player has to contribute a set amount of coins to the total prize pool. Once the match ends a commission is subtracted from the prize pool and the remaining coins are evenly distributed between all players who were on the winning team. Bets support any number of teams and players per team. Since it's possible to create a match with two teams and one player on each team, bets can be used as duels where two players play a 1v1 match.

Configuration

Bets, like other types of competitiveness, are configured through the Elympics.Communication.Rooms.PublicModels.CompetitivenessConfig class. To create a configuration for a bet call the CompetitivenessConfig.Bet static method and pass the ID of the desired coin and a bet amount. Number of teams and players in each team will be determined by the matchmaking queue used.

Example

IReadOnlyDictionary<Guid, VirtualDepositInfo> deposits = PlayPadCommunicator.Instance.VirtualDepositCommunicator.UserDepositCollection; //Placing a bet requires a battle wallet
Guid coinId = deposits.First().Value.CoinInfo.Id; //Get any valid ID, because this is just an example
CompetitivenessConfig config = CompetitivenessConfig.Bet(coinId, 1); //Create configuration for a bet with entry fee of 1 coin
UniTask<IRoom> task = ElympicsLobbyClient.Instance.RoomsManager.StartQuickMatch("Default", competitivenessConfig: config); //Matchmaking queue name should match the queue you want to use
task.Forget(); //Start the matchmaking process and don't for the result

To understand the meaning of deposits in this example, check out the battle wallet atricle.