Skip to main content
Verticopolis engine

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§

HELD_HOURS_SAVE_VERSION
The version a save with a held hour and no floor run is written at.
LOG_RING_CAP
How many messages Simulation::log keeps; the oldest goes first.
PLAIN_SAVE_VERSION
The version a save with no tall lobby is written at: the format before lobbyHeights, which it does not need.
SAVE_VERSION
The newest 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.
TALL_LOBBY_SAVE_VERSION
The version a save with a tall lobby and no held hour is written at.

Functions§

save_version
A save with no held hour is stamped TALL_LOBBY_SAVE_VERSION with a tall lobby, else PLAIN_SAVE_VERSION; stamped_save_version also weighs the held hours.
stamped_save_version
A save with no floor run is stamped HELD_HOURS_SAVE_VERSION when a schedule holds an hour back (an older build runs the whole fleet there), else TALL_LOBBY_SAVE_VERSION with a tall lobby, else PLAIN_SAVE_VERSION.