Skip to main content
Verticopolis engineGitHub

Module sim

Module sim 

Source
Expand description

One game: Simulation holds a whole tower, its people, its money and its clock, and every player command and time step goes through it.

use verticopolis_engine::clock::GameMode;
use verticopolis_engine::facilities::Kind;
use verticopolis_engine::sim::Simulation;

let mut sim = Simulation::new_game(42, GameMode::Classic);
for x in 100..124 {
    sim.build(Kind::Lobby, 1, x);
}
sim.tick(60.0);
assert!(sim.money < verticopolis_engine::sim::STARTING_MONEY);

Structs§

LogEntry
One message in the game’s log.
Simulation
One game of Verticopolis.

Enums§

LogKind
How the game styles a message in its log.

Constants§

LOG_RING_CAP
How many messages Simulation::log keeps; the oldest goes first.
SAVE_VERSION
The save format version this engine writes. It loads every older version back to the oldest one crate::identity::identity names.
STARTING_MONEY
The money a new game starts with.