[−][src]Crate screeps
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 crate::constants::*; |
pub use crate::objects::*; |
pub use crate::traits::FromExpectedType; |
pub use crate::traits::IntoExpectedType; |
Modules
constants | Constants, most copied from the game constants. |
game | |
inter_shard_memory |
|
js_collections | Typed JavaScript collection wrappers. |
macros | This file groups all macros used throughout the library. Since interop with javascript often gets unwieldy, macros are used extensively to follow DRY principles. |
memory | Interface with Screeps' |
objects | Screeps object wrappers. |
pathfinder | |
prelude | Useful for |
raw_memory | Interface for Screeps |
traits | Useful traits for interacting with JavaScript above what |
Macros
mem_get | Get a value from memory given a path, returning |
mem_set | Set a value in memory given a path, creating dicts for intermediate places if they do not exist. |
Structs
JsVec | Reference to a JavaScript array which is expected to contain a specific type of item. |
LocalRoomName | A structure representing a room name. |
LocalRoomNameParseError | An error representing when a string can't be parsed into a
|
LocalRoomPosition | This is a room position located in Rust memory. |