# Game Interface

The `GameInterface` is an integral part of a Celestium gaming ecosystem, designed to standardize how games interact within the rest system. This interface ensures that any game implementing it will adhere to a specific structure, making it easier to integrate with wallets, other games, or platforms that need to interact with various games without knowing their internal implementations.

The interface now supports House, PvP, Lottery, and Mirror Game templates to ensure deterministic payouts.

## Game Category Logic

* **House Games:** Players play against the LP; funds are reserved at the time of the bet.
* **PvP Games:** Players compete against each other; fees are deducted upfront.
* **Lottery:** Feature LP-backed progressive jackpots with two-phase settlement.

## Key Functions

The interface consists of several crucial functions, each serving a specific purpose within the gaming ecosystem:

| Function       | Returns   | Description                                                                                                                                                                                                                 |
| -------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `getAddress()` | `address` | Returns the address of the game contract. Useful for identification and transactions.                                                                                                                                       |
| `getVersion()` | `uint256` | Provides the version of the game. This could be used for compatibility checks.                                                                                                                                              |
| `getFeeType()` | `uint256` | Indicates the type of fee mechanism the game uses. `0` means the fee is taken from the player's bet, generally for Shared Games, while `1` indicates the fee comes from the game's core balance, generally for Lotto Games. |
| `getStaking()` | `address` | Returns the address of the staking contract associated with the game, if any. Staking to be used for rewards or other in-game mechanics.                                                                                    |
| `placeBet()`   | `address` | A function to place a bet or initiate a game action. It requires the player's address, the amount, and any relevant game data.                                                                                              |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.celestium.digital/smartcontracts-description/game-interface.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
