This commit is contained in:
@@ -151,7 +151,7 @@ mod tests {
|
||||
|
||||
fn get_user(level: LevelInt) -> Pokemon {
|
||||
let lib = Arc::new(crate::dynamic_data::libraries::dynamic_library::test::build());
|
||||
let species = lib.static_data().species().get(&"foo".into()).unwrap().clone();
|
||||
let species = lib.static_data().species().get(&"foo".into()).unwrap();
|
||||
let form = species.get_form(&"default".into()).unwrap();
|
||||
|
||||
Pokemon::new(
|
||||
|
||||
@@ -117,7 +117,7 @@ impl Battle {
|
||||
number_of_hits,
|
||||
choice.user().clone(),
|
||||
used_move.clone(),
|
||||
move_data.clone(),
|
||||
move_data,
|
||||
move_choice.script().clone(),
|
||||
);
|
||||
let mut prevented = false;
|
||||
|
||||
@@ -141,8 +141,7 @@ impl Pokemon {
|
||||
.static_data()
|
||||
.natures()
|
||||
.get_nature(nature)
|
||||
.unwrap_or_else(|| panic!("Unknown nature name was given: {}.", &nature))
|
||||
.clone();
|
||||
.unwrap_or_else(|| panic!("Unknown nature name was given: {}.", &nature));
|
||||
let mut pokemon = Self {
|
||||
identifier: Default::default(),
|
||||
library,
|
||||
@@ -892,7 +891,7 @@ pub mod test {
|
||||
#[test]
|
||||
fn construct_pokemon() {
|
||||
let lib = mock_library();
|
||||
let species = lib.static_data().species().get(&"foo".into()).unwrap().clone();
|
||||
let species = lib.static_data().species().get(&"foo".into()).unwrap();
|
||||
let form = species.get_form(&"default".into()).unwrap();
|
||||
|
||||
let pokemon = Pokemon::new(
|
||||
|
||||
@@ -46,7 +46,7 @@ impl PokemonBuilder {
|
||||
Random::default()
|
||||
};
|
||||
|
||||
let species = self.library.static_data().species().get(&self.species).unwrap().clone();
|
||||
let species = self.library.static_data().species().get(&self.species).unwrap();
|
||||
let form = species.get_default_form();
|
||||
let p = Pokemon::new(
|
||||
self.library,
|
||||
|
||||
@@ -36,7 +36,7 @@ impl ScriptSet {
|
||||
|
||||
/// Adds a script with a name to the set. If the script with that name already exists in this
|
||||
/// set, this makes that script stack instead. The return value here is that script.
|
||||
pub fn stack_or_add<'b, F>(&self, key: &StringKey, instantiation: &'b F) -> PkmnResult<Option<ScriptContainer>>
|
||||
pub fn stack_or_add<F>(&self, key: &StringKey, instantiation: &F) -> PkmnResult<Option<ScriptContainer>>
|
||||
where
|
||||
F: Fn() -> PkmnResult<Option<Arc<dyn Script>>>,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user