Struct ezomyte::Experience
[−]
[src]
pub struct Experience { /* fields omitted */ }
Experience gained by a gem.
Methods
impl Experience
[src]
pub fn new(current: u64, total: u64) -> Self
[src]
Create an Experience
object with given current & total values.
pub fn zero_out_of(total: u64) -> Self
[src]
Create an Experience
object which represents a 0/total state.
pub fn full(total: u64) -> Self
[src]
Create an Experience
object which represents
a filled experience bar with given total.
Such state correspond to a skill gem that is deliberately kept at a lower level.
impl Experience
[src]
pub fn current(&self) -> u64
[src]
Experience for current level earned so far. This is always lower than total.
pub fn total(&self) -> u64
[src]
Total experience before the next level.
pub fn is_empty(&self) -> bool
[src]
Whether the experience "bar" is completely empty.
pub fn is_full(&self) -> bool
[src]
Whether the experience "bar" is fully filled.
pub fn fraction(&self) -> f64
[src]
Experience as a 0..=1 fraction.
pub fn percentage(&self) -> f64
[src]
Experience as a percentage value.
Trait Implementations
impl Clone for Experience
[src]
fn clone(&self) -> Experience
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Experience
[src]
impl Add<u64> for Experience
[src]
type Output = Experience
The resulting type after applying the +
operator.
fn add(self, rhs: u64) -> Self
[src]
Performs the +
operation.
impl AddAssign<u64> for Experience
[src]
fn add_assign(&mut self, rhs: u64)
[src]
Performs the +=
operation.
impl Display for Experience
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Debug for Experience
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'de> Deserialize<'de> for Experience
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more