use std::marker::PhantomData;
use bevy_ecs::entity::Entity;
use bevy_ecs::event::EntityEvent;
use brink_runtime::Choice;
#[derive(EntityEvent)]
pub struct BrinkLineDelivered<M: Send + Sync + 'static = ()> {
pub entity: Entity,
pub text: String,
pub tags: Vec<String>,
_marker: PhantomData<fn() -> M>,
}
impl<M: Send + Sync + 'static> BrinkLineDelivered<M> {
pub(crate) fn new(entity: Entity, text: String, tags: Vec<String>) -> Self {
Self {
entity,
text,
tags,
_marker: PhantomData,
}
}
}
#[derive(EntityEvent)]
pub struct BrinkChoicesPresented<M: Send + Sync + 'static = ()> {
pub entity: Entity,
pub text: String,
pub tags: Vec<String>,
pub choices: Vec<Choice>,
_marker: PhantomData<fn() -> M>,
}
impl<M: Send + Sync + 'static> BrinkChoicesPresented<M> {
pub(crate) fn new(
entity: Entity,
text: String,
tags: Vec<String>,
choices: Vec<Choice>,
) -> Self {
Self {
entity,
text,
tags,
choices,
_marker: PhantomData,
}
}
}
#[derive(EntityEvent)]
pub struct BrinkTurnDone<M: Send + Sync + 'static = ()> {
pub entity: Entity,
pub text: String,
pub tags: Vec<String>,
_marker: PhantomData<fn() -> M>,
}
impl<M: Send + Sync + 'static> BrinkTurnDone<M> {
pub(crate) fn new(entity: Entity, text: String, tags: Vec<String>) -> Self {
Self {
entity,
text,
tags,
_marker: PhantomData,
}
}
}
#[derive(EntityEvent)]
pub struct BrinkStoryEnded<M: Send + Sync + 'static = ()> {
pub entity: Entity,
pub text: String,
pub tags: Vec<String>,
_marker: PhantomData<fn() -> M>,
}
impl<M: Send + Sync + 'static> BrinkStoryEnded<M> {
pub(crate) fn new(entity: Entity, text: String, tags: Vec<String>) -> Self {
Self {
entity,
text,
tags,
_marker: PhantomData,
}
}
}
#[cfg(feature = "dev")]
#[derive(EntityEvent)]
pub struct BrinkFlowReset<M: Send + Sync + 'static = ()> {
pub entity: Entity,
_marker: PhantomData<fn() -> M>,
}
#[cfg(feature = "dev")]
impl<M: Send + Sync + 'static> BrinkFlowReset<M> {
pub(crate) fn new(entity: Entity) -> Self {
Self {
entity,
_marker: PhantomData,
}
}
}