rustorio_engine/gamemodes.rs
1//! A game mode defines the starting resources and victory conditions for a game.
2
3/// The starting resources of a game mode. These are provided to the player at the beginning of the game.
4pub trait StartingResources {
5 /// Called once at the start of the game before control is handed to the player to create the starting resources.
6 fn init() -> Self;
7}
8
9/// A game mode defines the starting resources and victory conditions for a game.
10pub trait GameMode {
11 /// Starting resources provided to the player at the beginning of the game.
12 #[allow(private_bounds)]
13 type StartingResources: StartingResources;
14 /// Resources required to achieve victory.
15 type VictoryResources;
16}