Skip to content

Commit

Permalink
little tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
shanemadden committed Dec 18, 2023
1 parent e696273 commit 02b5f0f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
//! and no Javascript garbage collection happening for its memory space,
//! allowing for faster execution of some types of workloads. Overall, the
//! advantages and disadvantages of WebAssembly in Screeps are relatively small,
//! especially when compared to the relatively high 0.2ms cost of game
//! actions.
//! especially when compared to the relatively high 0.2ms cost of game actions.
//!
//! # Data Persistence
//!
Expand Down
3 changes: 2 additions & 1 deletion src/local/cost_matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ use super::{linear_index_to_xy, xy_to_linear_index, Position, RoomXY, ROOM_AREA}

/// A matrix of pathing costs for a room, stored in Rust memory.
///
/// Use [`CostMatrix`] if data stored in JavaScript memory is preferred.
/// Use [`CostMatrix`] if a reference to data stored in JavaScript memory is
/// preferred.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(transparent)]
pub struct LocalCostMatrix {
Expand Down
11 changes: 6 additions & 5 deletions src/local/object_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ pub use raw::*;
/// Represents an Object ID and a type that the ID points to, stored in Rust
/// memory.
///
/// Use [`JsObjectId`] If a reference stored in JavaScript memory is preferred.
/// Use [`JsObjectId`] if a reference stored in JavaScript memory is preferred.
///
/// Each object id in screeps is represented by an ID of up to 24 hexidemical
/// characters, which cannot change. This implementation takes advantage of that
/// by storing a packed representation in a `u128`, using 96 bits for the ID and
/// 32 bits for tracking the length of the ID string for reconstruction in JS.
/// Each object ID in Screeps: World is represented by an ID of up to 24
/// hexidemical characters, which cannot change. This implementation takes
/// advantage of that by storing a packed representation in a `u128`, using 96
/// bits for the ID and 32 bits for tracking the length of the ID string for
/// reconstruction in JS.
///
/// # Conversion
///
Expand Down

0 comments on commit 02b5f0f

Please sign in to comment.