Expand description
screeps-game-api
Cargo Features
check-all-casts
By default, screeps-game-api
assumes that the Screeps JavaScript API calls return the types
that they are documented to return and bypasses instanceof
checks when constructing rust
wrappers for those return values.
To enable checking all types on all API calls, even ones when the screeps server reliably
returns the expected type, depend on screeps-game-api
with the "check-all-casts"
feature
flag:
[dependencies]
screeps-game-api = { version = "0.3", features = ["check-all-casts"] }
Re-exports
pub use traits::FromExpectedType;
pub use traits::IntoExpectedType;
pub use constants::*;
pub use objects::*;
Modules
Constants, most copied from the game constants.
Interface with Screeps’
Memory
global variableScreeps object wrappers.
Useful for
use screeps::prelude::*;
to bring in screeps traits. Does not contain any
structures in order to minimize namespace polution.Interface for Screeps
RawMemory
global object.Macros
Get a value from memory given a path, returning
None
if any thing along the way does not
exist.Set a value in memory given a path, creating dicts for intermediate places if they do not exist.
Structs
A structure representing a room name.