screeps/
objects.rs

1//! Screeps object wrappers.
2//!
3//! Objects types that inherit [`RoomObject`] represent game objects with are
4//! valid to be used only during the current tick; reading or writing a 'stale'
5//! game object from a past tick will result in undefined behavior.
6mod impls;
7
8pub use event::*;
9pub use game_types::*;
10pub use input::*;
11pub use output::*;
12pub use room_objects::*;
13pub use visual::*;
14
15/// Object wrappers representing data retrieved from room event logs.
16pub mod event {
17    pub use super::impls::{
18        AttackEvent, AttackType, BuildEvent, Event, EventType, ExitEvent, HarvestEvent, HealEvent,
19        HealType, ObjectDestroyedEvent, PowerEvent, RepairEvent, ReserveControllerEvent,
20        TransferEvent, UpgradeControllerEvent,
21    };
22}
23
24/// Object wrappers for game types that are not room objects (are safe to use
25/// in future ticks).
26mod game_types {
27    pub use super::impls::{CostMatrix, RoomPosition, RoomTerrain};
28}
29
30/// Object wrappers for simple javascript objects with known properties sent to
31/// game functions.
32pub mod input {
33    pub use super::impls::{FindPathOptions, JsFindPathOptions, MoveToOptions};
34}
35
36/// Object wrappers for simple javascript objects with known properties returned
37/// by game functions.
38pub mod output {
39    pub use super::impls::{
40        AccountPowerCreep, BodyPart, Effect, InterShardPortalDestination, Owner, Path,
41        PortalDestination, PowerInfo, Reservation, Sign, SpawnOptions, Step,
42    };
43}
44
45/// Object wrappers for room objects.
46mod room_objects {
47    pub use super::impls::{
48        ConstructionSite, Creep, Deposit, Flag, Mineral, Nuke, OwnedStructure, PowerCreep,
49        Resource, Room, RoomObject, Ruin, Source, Spawning, Store, Structure, StructureContainer,
50        StructureController, StructureExtension, StructureExtractor, StructureFactory,
51        StructureInvaderCore, StructureKeeperLair, StructureLab, StructureLink, StructureNuker,
52        StructureObserver, StructurePortal, StructurePowerBank, StructurePowerSpawn,
53        StructureRampart, StructureRoad, StructureSpawn, StructureStorage, StructureTerminal,
54        StructureTower, StructureWall, Tombstone,
55    };
56
57    #[cfg(feature = "seasonal-season-1")]
58    pub use super::impls::{ScoreCollector, ScoreContainer};
59
60    #[cfg(feature = "seasonal-season-2")]
61    pub use super::impls::{SymbolContainer, SymbolDecoder};
62
63    #[cfg(feature = "seasonal-season-5")]
64    pub use super::impls::Reactor;
65}
66
67/// Object wrappers allowing drawing of shapes in rooms or on the map in the
68/// game world.
69pub mod visual {
70    pub use super::impls::{
71        CircleStyle, FontStyle, LineDrawStyle, LineStyle, MapFontStyle, MapFontVariant,
72        MapTextStyle, MapVisual, MapVisualShape, PolyStyle, RectStyle, RoomVisual, TextAlign,
73        TextStyle, Visual,
74    };
75}