valence/src/enchant.rs
Terminator b83b9f76ed
Expose enchantments to Rust (#99)
* Expose extracted enchantments to Rust.

* Give enchantments a `level: i16` field.

* Update enchantment derive impls

* Restructure how enchants are exposed to Rust through C-like enums

* Update build/enchant.rs

Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>

* Update build/enchant.rs

Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>

* Move enchantment sources to their own struct.

* make id() function return it's discriminant instead of matching

Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>
2022-10-03 13:19:42 -07:00

5 lines
330 B
Rust

// enchant.rs exposes constant values provided by the build script.
// All enchantment variants are located in `EnchantmentKind`. You can use the
// associated const fn functions of `EnchantmentKind` to access details about an
// enchantment type. enchantment specific functions
include!(concat!(env!("OUT_DIR"), "/enchant.rs"));