A framework for the Godot engine to create TTRPG games for Advanced 5th Edition, Pathfinder 2nd Edition, and more

Adding different modules for each system

+42
src/a5e/mod.rs

This is a binary file and will not be displayed.

src/dnd5e/mod.rs

This is a binary file and will not be displayed.

+12
src/lib.rs
··· 1 1 pub mod hooks; 2 2 pub mod traits; 3 3 4 + #[cfg(feature = "pf2e")] 5 + pub mod pf2e; 6 + 7 + #[cfg(feature = "a5e")] 8 + pub mod a5e; 9 + 10 + #[cfg(feature = "dnd5e")] 11 + pub mod dnd5e; 12 + 13 + #[cfg(feature = "sf2e")] 14 + pub mod sf2e; 15 + 4 16 use hooks::Hooks; 5 17 use traits::DiceWireSystem; 6 18 use uuid::Uuid;
+30
src/pf2e/mod.rs
··· 1 + use crate::traits::{DiceWireSystem, DiceWireActor, Serializable}; 2 + use uuid::Uuid; 3 + use serde::Serialize; 4 + 5 + pub struct DiceWirePF2E { 6 + 7 + } 8 + 9 + impl DiceWireSystem for DiceWirePF2E { 10 + fn name(&self) -> &str { 11 + "Pathfinder 2E" 12 + } 13 + 14 + fn get_actor(&self, uuid: Uuid) -> Box<dyn DiceWireActor> { 15 + Box::new(DiceWirePF2EActor{}) 16 + } 17 + } 18 + 19 + #[derive(Serialize)] 20 + pub struct DiceWirePF2EActor { 21 + 22 + } 23 + 24 + impl DiceWireActor for DiceWirePF2EActor {} 25 + 26 + impl Serializable for DiceWirePF2EActor { 27 + fn serialize(&self) -> Vec<u8> { 28 + rmp_serde::to_vec(self).unwrap() 29 + } 30 + }
src/sf2e/mod.rs

This is a binary file and will not be displayed.