tutorial_new_game/
tutorial_new_game.rs

1#![deny(unsafe_code)]
2
3use rustorio::{
4    self, Bundle, ResourceType, Tick,
5    gamemodes::{self},
6};
7
8type GameMode = gamemodes::Tutorial;
9
10type StartingResources = <GameMode as gamemodes::GameMode>::StartingResources;
11
12fn main() {
13    rustorio::play::<GameMode>(user_main);
14}
15
16fn user_main(mut tick: Tick, starting_resources: StartingResources) -> (Tick, Bundle<{ ResourceType::Copper }, 1>) {
17    let StartingResources { iron } = starting_resources;
18
19    todo!("Use the iron to create a smelter, mine some copper ore, and smelt it into copper ingots to win the game.")
20    // For more information on building a furnace, see https://albertsgarde.github.io/rustorio/rustorio/buildings/struct.Furnace.html
21    // To mine copper ore, see https://albertsgarde.github.io/rustorio/rustorio/fn.mine_copper.html
22
23    // To win, simply return the `Tick` and a `Bundle` containing 1 copper ingot.
24    // To get a `Bundle` containing copper ingots, you can either take it directly from a furnace using `Furnace::take_output`,
25    // or create extract it from a `Resource` using `Resource::bundle`.
26}