A card game engine for TCGs, primarily Magic: The Gathering but with support for others
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Creating a custom node

+25 -11
+8 -1
gdext/Cargo.toml
··· 3 3 version = "0.1.0" 4 4 edition = "2024" 5 5 6 + [lib] 7 + crate-type = ["cdylib"] 8 + 6 9 [dependencies] 7 10 8 11 [dependencies.managrove-core] 9 - path = "../managrove-core" 12 + path = "../managrove-core" 13 + 14 + [dependencies.godot] 15 + version = "0.5.1" 16 + features = ["api-4-6"]
+17 -10
gdext/src/lib.rs
··· 1 - pub fn add(left: u64, right: u64) -> u64 { 2 - left + right 1 + use godot::prelude::*; 2 + 3 + #[derive(GodotClass)] 4 + #[class(base=Node)] 5 + struct ManaGroveNode { 6 + #[base] 7 + base: Base<Node>, 8 + // other data 3 9 } 4 10 5 - #[cfg(test)] 6 - mod tests { 7 - use super::*; 11 + #[gdextension] 12 + unsafe impl ExtensionLibrary for ManaGroveNode {} 8 13 9 - #[test] 10 - fn it_works() { 11 - let result = add(2, 2); 12 - assert_eq!(result, 4); 14 + #[godot_api] 15 + impl INode for ManaGroveNode { 16 + fn init(base: Base<Node>) -> Self { 17 + Self { 18 + base 19 + } 13 20 } 14 - } 21 + }