Skip to main content
Verticopolis engineGitHub

Module charges

Module charges 

Source
Expand description

Commands that cost or refund money after a build: elevator cars (Simulation::add_car, Simulation::remove_car), stretching a shaft (Simulation::extend_transport) and removing a room or a shaft (Simulation::remove_facility).

Each one checks, changes the tower and moves the money in one step and reports the amount, so a frontend sends the command and never writes money itself.

Structs§

ChargeResult
What a charged command did.
ExtendResult
What an extension did: the charge, and the shaft’s span afterwards.

Enums§

ExtendEnd
Which end of a shaft an extension moves.

Constants§

ADD_CAR_COST
The price of one more elevator car.
INVALID_REQUEST
The refusal for a malformed command, such as a brush with too many tiles. The JavaScript binding also gives it for an id or floor that is not a whole number, or an unknown name; a Rust host passes typed values and never sees those cases.
TRANSPORT_FLOOR_COST
The price of each floor an elevator is built or extended past its first.