pub struct Goal {
pub name: String,
pub priority: f32,
pub desired_state: WorldState,
}Expand description
Goal for GOAP planning
Fields§
§name: StringGoal name
priority: f32Priority (higher = more important)
desired_state: WorldStateDesired world state
Implementations§
Source§impl Goal
impl Goal
Sourcepub const fn with_priority(self, priority: f32) -> Self
pub const fn with_priority(self, priority: f32) -> Self
Sets the priority
Sourcepub fn with_condition(self, key: impl Into<String>, value: bool) -> Self
pub fn with_condition(self, key: impl Into<String>, value: bool) -> Self
Adds a desired condition
Sourcepub fn is_satisfied(&self, state: &WorldState) -> bool
pub fn is_satisfied(&self, state: &WorldState) -> bool
Checks if the goal is satisfied by the current state
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Goal
impl<'de> Deserialize<'de> for Goal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Goal
impl RefUnwindSafe for Goal
impl Send for Goal
impl Sync for Goal
impl Unpin for Goal
impl UnwindSafe for Goal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more