mnml/core/src/mob.rs
2019-12-05 16:20:44 +10:00

31 lines
643 B
Rust

use uuid::Uuid;
use std::iter;
use construct::{Construct};
use names::{name};
use player::{Player};
pub fn generate_mob() -> Construct {
let mob = Construct::new()
.named(&name());
return mob;
}
pub fn instance_mobs(player_id: Uuid) -> Vec<Construct> {
iter::repeat_with(||
generate_mob()
.set_account(player_id))
// .learn(Skill::Attack))
.take(3)
.collect::<Vec<Construct>>()
}
pub fn bot_player() -> Player {
let bot_id = Uuid::new_v4();
let constructs = instance_mobs(bot_id);
Player::new(bot_id, None, &name(), constructs).set_bot(true)
}