Function screeps::game::get_object_typed

source ·
pub fn get_object_typed<T>(id: &str) -> Result<Option<T>, ConversionError>where
    T: HasId,
Expand description

See [http://docs.screeps.com/api/#Game.getObjectById]

This gets an object expecting a specific type and will return a ConversionError if the type does not match.

If all you want to assume is that something has an ID, use get_object_erased. [http://docs.screeps.com/api/#Game.getObjectById]: http://docs.screeps.com/api/#Game.getObjectById