mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Move agent data into structs
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
comp::{humanoid, quadruped_low, quadruped_medium, quadruped_small, Body},
|
comp::{humanoid, quadruped_low, quadruped_medium, quadruped_small, Body},
|
||||||
|
path::Chaser,
|
||||||
rtsim::RtSimController,
|
rtsim::RtSimController,
|
||||||
uid::Uid,
|
uid::Uid,
|
||||||
};
|
};
|
||||||
@ -186,8 +187,8 @@ pub struct Target {
|
|||||||
pub struct Agent {
|
pub struct Agent {
|
||||||
pub rtsim_controller: RtSimController,
|
pub rtsim_controller: RtSimController,
|
||||||
pub patrol_origin: Option<Vec3<f32>>,
|
pub patrol_origin: Option<Vec3<f32>>,
|
||||||
pub activity: Activity,
|
|
||||||
pub target: Option<Target>,
|
pub target: Option<Target>,
|
||||||
|
pub chaser: Chaser,
|
||||||
/// Does the agent talk when e.g. hit by the player
|
/// Does the agent talk when e.g. hit by the player
|
||||||
// TODO move speech patterns into a Behavior component
|
// TODO move speech patterns into a Behavior component
|
||||||
pub can_speak: bool,
|
pub can_speak: bool,
|
||||||
@ -225,19 +226,3 @@ impl Agent {
|
|||||||
impl Component for Agent {
|
impl Component for Agent {
|
||||||
type Storage = IdvStorage<Self>;
|
type Storage = IdvStorage<Self>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
|
||||||
pub enum Activity {
|
|
||||||
Idle,
|
|
||||||
IdleTree,
|
|
||||||
Interact,
|
|
||||||
Flee,
|
|
||||||
Follow,
|
|
||||||
HostileTree,
|
|
||||||
Attack,
|
|
||||||
ChooseTarget,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for Activity {
|
|
||||||
fn default() -> Self { Self::IdleTree }
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user