Expand description
§Types
This includes various enums related to the type of character you have
Basic is the basic type Good or Bad
Normal has elemental types
Advanced has elemental types
§Effectiveness
Basic has no need for effectiveness against types, so you can implement your own Compare if you like
use rpg_stat::types::Basic;
use rpg_stat::types::Compare;
use rpg_stat::attributes::Effectiveness;
use std::fmt;
use std::fmt::Debug;
use std::fmt::Display;
use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Rem, RemAssign, Sub, SubAssign};
extern crate num;
use num::NumCast;
// Work around it
struct MyType(Basic);
// here it is.
impl Compare for MyType {
type Type = Basic;
// Plant Effectiveness against a target
fn plant(other:Basic) -> Effectiveness {
Effectiveness::Normal
}
/// Rock Effectiveness against a target
fn rock(other:Basic) -> Effectiveness {
Effectiveness::Normal
}
/// Water Effectiveness against a target
fn water(other:Basic) -> Effectiveness {
Effectiveness::Normal
}
/// Fire Effectiveness against a target
fn fire(other:Basic) -> Effectiveness {
Effectiveness::Normal
}
/// Electric Effectiveness against a target
fn electric(other:Basic) -> Effectiveness {
Effectiveness::Normal
}
/// Spirit Effectiveness against a target
fn spirit(other:Basic) -> Effectiveness {
Effectiveness::Normal
}
/// Light Effectiveness against a target
fn light(other:Basic) -> Effectiveness {
Effectiveness::Normal
}
/// Wind Effectiveness against a target
fn wind(other:Basic) -> Effectiveness {
Effectiveness::Normal
}
/// None Effectiveness against a target
fn none(other:Basic) -> Effectiveness {
Effectiveness::Normal
}
/// Effectiveness against a target
fn effectiveness(&self, other:Basic) -> Effectiveness {
Effectiveness::Normal
}
}Normal implements this, see the Compare trait
This can be compared easily using the Compare trait
Advanced is currently the same as Normal