Skip to content

Commit

Permalink
docs: usage example for create_construction_site
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfrank committed Nov 2, 2024
1 parent c9cca0d commit 796a4f8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/game/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ extern "C" {
fn error(this: &CreateConstructionSiteResult) -> ReturnCode;
}

/// Create a new construction site at the specified location. Returns the
/// ConstructionSite object instance. You can create maximum 10 active
/// construction sites.
///
/// Example usage:
/// ```
/// use screeps_arena::STRUCTURE_TOWER_PROTOTYPE;
/// use screeps_arena::game;
/// let ret = game::utils::create_construction_site(10, 20, &STRUCTURE_TOWER_PROTOTYPE);
/// ```
pub fn create_construction_site(
x: u8,
y: u8,
Expand Down

0 comments on commit 796a4f8

Please sign in to comment.