Expand description
§Doryen-extra
Doryen-extra aims to be a loose re-implementation of the utility features from the popular roguelike
library named libtcod, which is also known as the Doryen Library. The doryen-rs crate fulfills
the re-implementation of the game engine part of the library, but is otherwise (at the time of writing)
missing a lot of the features that were present in libtcod.
After finding myself frustrated with the various limitations and hassles that are involved when
wrapping a C library in rust, which is what the tcod crate has done, I decided to just go
all-in and re-code the library in Rust.
While I could’ve just copied and pasted the code as it was, and turned it into Rust with minimal modifications,
I wanted to make it a proper Rust library, so it has been coded with retaining functionality in mind,
but not with retaining form. By that, I mean that all the functionality you’re used to from libtcod should
be present, but how it’s accessed or used may vary greatly from the original.
§Features
§doryen
While this library is called doryen-extra, I didn’t actually want to force it to be tied to the
doryen-rs library, so functionality that pertains to it is behind the feature doryen. If
you want to use this library without bringing in doryen-rs as a dependency, just put
[dependencies]
doryen-extra = { version = "...", default-features = false }in your Cargo.toml file, which removes the default doryen feature.
§libtcod-compat
This feature restores (on a best-effort basis) the functionality of the original
libtcod library, where it has been modified. At the time of writing, the only change that
will happen is to the float generation of the ComplementaryMultiplyWithCarry RNG algorithm.
§rng_support
With this feature enabled, the Random struct implements rand_core::RngCore and
rand_core::SeedableRng, which lets it be used in any place that accepts the rand crate RNGs.
§serialization
With this feature enabled, all types for which it makes sense to serialize will implement
serde::ser::Serialize and serde::de::Deserialize. NOTE: More types may get implementations
for this in the future.
§Missing Features / Toolkits
The following toolkits from libtcod have not yet been converted, with possible reason given in parenthesis:
bsptoolkit: 2D Binary Space Partitionfovtoolkit: Easily calculate the potential visible set of map cells from the player positionimagetoolkit: Some image manipulation utilities (undecided on whether to convert this one; other crates may already serve this purpose)listtoolkit: A fast, lightweight and generic container, that provides array, list and stack paradigms (useVecinstead)namegentoolkit: Allows one to generate random names out of custom made syllable sets (parts requiresparsetoolkit)parsetoolkit: An easy way to parse complex text configuration files
Modules§
- bresenham
- Line drawing using the Bresenham algorithm.
- color
- Color representation and operations.
- extenders
- Extenders for doryen-rs types.
- extensions
- Extension traits for doryen-rs types.
- heightmap
- Height map generation.
- noise
- Noise generation.
- random
- Pseudorandom number generator using the Mersenne Twister or Complementary Multiply With Carry algorithms.
Structs§
- FPosition
- A struct representing a floating-point
Position
determined by its
xandyvalues. - FRectangle
- Represents a floating-point rectangle, using a position and size.
- FSize
- A struct representing a floating-point
Size
determined by its
widthandheightvalues. - Position
- A struct representing a
Position
determined by its
xandyvalues. - Rectangle
- Represents a rectangle, using a position and size.
- Size
- A struct representing a
Size
determined by its
widthandheightvalues. - UPosition
- A struct representing an unsigned
Position
determined by its
xandyvalues. - USize
- A struct representing an unsigned
Size
determined by its
widthandheightvalues.
Enums§
- TryFrom
Position Error - The error type returned when a checked Position type conversion fails.
- TryFrom
Size Error - The error type returned when a checked Size type conversion fails.