Skip to content

Commit

Permalink
Prep 0.22 release (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
shanemadden authored Aug 27, 2024
1 parent ca47f73 commit 36f7057
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Unreleased
==========

0.22.0 (2024-08-27)
===================

- Updated to 0.22 of screeps-game-api crate
- Add `algorithms::distance_transform` module with functions for calculating distance transforms
- Add dependency on `chrono` crate for handling returned date types
- Add `object::creation_datetime` function for determining the creation timestamp of objects
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "screeps-game-utils"
version = "0.21.1"
version = "0.22.0"
authors = ["Shane Madden"]
documentation = "https://docs.rs/screeps-game-utils/"
edition = "2021"
Expand All @@ -23,8 +23,8 @@ name = "screeps_utils"
all-features = true

[dependencies]
chrono = "0.4"
screeps-game-api = "0.21"
chrono = ">=0.4.20"
screeps-game-api = "0.22"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_with = "3.8.1"
Expand Down
5 changes: 3 additions & 2 deletions src/algorithms/distance_transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ pub fn chebyshev_distance_transform_from_terrain(
}

/// Provides a Cost Matrix with values equal to the Chebyshev distance from any
/// position in the provided initial Cost Matrix with a value set to 0. This
/// allows for calculating the distance transform from an arbitrary set of
/// position in the provided initial Cost Matrix with a value set to 0.
///
/// This allows for calculating the distance transform from an arbitrary set of
/// positions. Other position values in the initial Cost Matrix should be
/// initialized to 255 (u8::MAX) to ensure the calculations work correctly.
pub fn chebyshev_distance_transform_from_cost_matrix(
Expand Down
4 changes: 4 additions & 0 deletions src/algorithms/floodfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pub fn get_obstacles_lcm_from_terrain(room_terrain: &LocalRoomTerrain) -> LocalC
obstacles
}

/// Generates a distance floodfill from origin positions.
///
/// Takes a Vec of origin locations to start the floodfill from, and a Cost
/// Matrix of obstacles, and produces a `LargeCostMatrix` with distances for all
/// positions that can be reached from the origin points.
Expand Down Expand Up @@ -103,6 +105,8 @@ pub fn numerical_floodfill(
output_cm
}

/// Generates a reachability floodfill from origin positions.
///
/// Takes a Vec of origin locations to start the floodfill from, and a Cost
/// Matrix of obstacles, and produces a Cost Matrix with 1 values for all
/// positions that can be reached from the origin points, and 0 values
Expand Down

0 comments on commit 36f7057

Please sign in to comment.