Module rpgstat::class [−][src]
Expand description
Character Class
This abstraction can be as Basic as Hero or Enemy
You can even use the fully Advanced version to use the entire class realm.
Builder
Make anything pretty easily from built in classes Basic, Normal, and Advanced
use rpgstat::stats::Builder;
use rpgstat::stats::Basic as Stat;
use rpgstat::class::Basic as Class;
let class:Class = Class::Hero;
let stat:Stat<f64> = class.build_basic(0.0, 1.0);Build a Basic stat
This is what the code does for Hero
type T = f64;
let hp:T = num::cast(10).unwrap();
let mp:T = num::cast(5).unwrap();
let xp:T = num::cast(1).unwrap();
let xp_next:T = num::cast(10).unwrap();
let gp:T = num::cast(5).unwrap();
let speed:T = num::cast(10).unwrap();Build a Normal stat
This is what the code does for Hero
type T = f64;
let hp:T = num::cast(10).unwrap();
let mp:T = num::cast(5).unwrap();
let xp:T = num::cast(1).unwrap();
let xp_next:T = num::cast(10).unwrap();
let gp:T = num::cast(5).unwrap();
let speed:T = num::cast(10).unwrap();
let atk:T = num::cast(10).unwrap();
let def:T = num::cast(10).unwrap();
let m_atk:T = num::cast(10).unwrap();
let m_def:T = num::cast(10).unwrap();Build a Advanced stat
This is what the code does for Hero
type T = f64;
let hp:T = num::cast(10).unwrap();
let mp:T = num::cast(5).unwrap();
let xp:T = num::cast(1).unwrap();
let xp_next:T = num::cast(10).unwrap();
let gp:T = num::cast(5).unwrap();
let speed:T = num::cast(10).unwrap();
let atk:T = num::cast(10).unwrap();
let def:T = num::cast(10).unwrap();
let m_atk:T = num::cast(10).unwrap();
let m_def:T = num::cast(10).unwrap();
let mut agility:T = num::cast(10).unwrap();
let mut strength:T = num::cast(10).unwrap();
let mut dexterity:T = num::cast(10).unwrap();
let mut constitution:T = num::cast(10).unwrap();
let mut intelligence:T = num::cast(10).unwrap();
let mut charisma:T = num::cast(10).unwrap();
let mut wisdom:T = num::cast(10).unwrap();
let mut age:T = num::cast(10).unwrap();