Skip to content

Commit

Permalink
fix too-long doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shanemadden committed Aug 27, 2024
1 parent 24f5c53 commit d780c67
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
9 changes: 6 additions & 3 deletions src/constants/extra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,12 @@ pub const CREEP_SAY_MAX_LENGTH: u32 = 10;
/// [`Flag`]: crate::objects::Flag
pub const FLAG_NAME_MAX_LENGTH: u32 = 100;

/// The cost of a single 'intent' (in milliseconds), a CPU penalty charged for
/// most successful API calls which change the game state ([`Creep::pull`],
/// [`Creep::say`], and [`PowerCreep::say`] are excepted)
/// The cost of a single 'intent' in CPU time, charged for all successful
/// changes to game state.
///
/// API calls which change the game state ([`Creep::pull`], [`Creep::say`], and
/// [`PowerCreep::say`] are excepted) will add this amount to your used CPU for
/// the tick each time they're successful.
///
/// [Code reference](https://github.com/screeps/driver/blob/97a9e51d124c7170429caa1621096f0f4d888d72/lib/runtime/runtime.js#L52)
///
Expand Down
7 changes: 4 additions & 3 deletions src/game/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ pub fn limit() -> u32 {
Cpu::limit()
}

/// The amount of CPU available for execution this tick, which consists of
/// your per-tick CPU [`limit`] plus your accrued [`bucket`], up to a maximum of
/// 500 ([`CPU_TICK_LIMIT_MAX`]); [`f64::INFINITY`] on sim.
/// The amount of CPU available for execution in a given tick.
///
/// consists of your per-tick CPU [`limit`] plus your accrued [`bucket`], up to
/// a maximum of 500 ([`CPU_TICK_LIMIT_MAX`]); [`f64::INFINITY`] on sim.
///
/// [`CPU_TICK_LIMIT_MAX`]: crate::constants::extra::CPU_TICK_LIMIT_MAX
pub fn tick_limit() -> f64 {
Expand Down
7 changes: 3 additions & 4 deletions src/game/market.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,9 @@ pub fn get_all_orders(filter: Option<&LodashFilter>) -> Vec<Order> {
}

/// Get information about the price history on the market for the last 14
/// days for a given resource as an [`Array`] of [`OrderHistoryRecord`]s, or
/// for all resources if `None`. Warning: returns an empty [`Object`]
/// instead of an array if there is no history for the resource, verifying
/// the type is recommended before use if the market might be empty.
/// days.
///
/// Gets information for a given resource, or for all resources if `None`.
///
/// [Screeps documentation](https://docs.screeps.com/api/#Game.market.getHistory)
pub fn get_history(resource: Option<ResourceType>) -> Vec<OrderHistoryRecord> {
Expand Down

0 comments on commit d780c67

Please sign in to comment.