Struct pokemon_go_data::Level [] [src]

pub struct Level { /* fields omitted */ }

Represents a Pokemon's level.

Methods

impl Level
[src]

[src]

Create a new Level from the given parameter. Returns None if the given value is not a valid level.

A value is a valid Level if:

  • 1 <= value <= 39
  • The fractional part of value is 0 or 0.5

Example:

use pokemon_go_data::Level;

let level = Level::new(20.5).unwrap();
assert_eq!(level.value(), 20.5);

assert!(Level::new(20.4).is_none());

[src]

The internal wrapped value.

[src]

Returns the combat power multiplier corresponding to this level. This value is used to calculate a Pokemon's combat power from its base stats.

[src]

Returns the lowest possible Pokemon level.

use pokemon_go_data::Level;

assert_eq!(Level::min().value(), 1.0);

[src]

Returns the highest possible Pokemon level.

use pokemon_go_data::Level;

assert_eq!(Level::max().value(), 39.0);

Trait Implementations

impl Debug for Level
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for Level
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl Eq for Level
[src]