Skip to main content

Crate rustorio

Crate rustorio 

Source
Expand description

The base mod for Rustorio. Contains all the main content of the game. Your saves should depend on this crate.

For more information, including help on getting started, see the repo

Modules§

buildings
Buildings take inputs to produce outputs over time.
gamemodes
A game mode defines the starting resources and victory conditions for a game.
guide
A guide that provides hints to the player during the tutorial.
recipes
A recipe is a way of turning resources into other resources. Some recipes can be performed by hand, but most can be automated using buildings like the Assembler or the Furnace. To figure out where the recipe can be performed, look at the trait impls. For example, the CopperWireRecipe implements the AssemblerRecipe and HandRecipe traits, meaning it can be performed by hand and in an Assembler.
research
Technologies can be unlocked by consuming science packs. They usually unlock new recipes or further technologies.
resources
Resources are the fundamental units of value in Rustorio. Resources are held in either Resource or Bundle objects. Bundle objects are used to hold a fixed amount of a resource, while Resource objects can hold any amount.
territory
Territories are where you can get ore. To begin with you can mine by hand using the hand_mine function, but later you can add Miners to the territory to automate mining.

Structs§

Bundle
Contains a fixed (compile-time known) amount of a resource. A Bundle can be used to build structures or as input for recipes.
InsufficientResourceError
Error returned when there are insufficient resources in a Resource to fulfill a request.
ResearchPoint
A resource type representing one research point for a specific Technology. Use them in the research method of the corresponding Technology to unlock the technology.
Resource
Holds an arbitrary amount of a resource. A Resource object can be split into smaller parts, combined or Bundles can be extracted from them.
Tick
The tick is used to keep track of time in the game. You can advance the game using the advance method or similar. Many functions and building methods require a Tick to be passed in, which allows them to update their state. If a function takes a &mut Tick, then the function will take time. If a function merely takes a &Tick, it will never advance the game time, but instead just roll forward it’s internal state to match the current tick.

Traits§

GameMode
A game mode defines the starting resources and victory conditions for a game.
HandRecipe
A recipe that can be hand-crafted by the player.
Recipe
Basic recipe trait. A building’s specific recipe trait can then be defined like
ResourceType
A type that represents a specific kind of resource in the game. Implementors of this trait represent different resource types, such as iron, copper, or science packs. Only useful as a type parameter; has no associated methods.
Technology
A technology can be unlocked out by calling the research method with the required science packs. This will consume the science packs and the technology itself, and return whatever the technology unlocks, mostly recipes and other technologies.

Functions§

play
Runs your play. If it is run multiple times, it will panic. This is to prevent using multiple threads to cheat.

Derive Macros§

Recipe