pub struct ScriptRunner<E: Event + EventRhaiEnum, S: State> { /* private fields */ }Implementations§
Source§impl<E: Event + EventRhaiEnum, S: State> ScriptRunner<E, S>
impl<E: Event + EventRhaiEnum, S: State> ScriptRunner<E, S>
pub fn new(game_config: &GameConfig) -> Self
pub fn compile_script_public(&self, script: &str) -> Result<AST>
pub fn build_type<T: CustomType>(&mut self)
pub fn register_module(&mut self, name: &str, script: &str)
pub fn run_test( &mut self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, script: &str, ) -> Vec<ScriptTestReport>
Sourcepub fn run_event(
&self,
scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>,
state: &S,
script: &str,
) -> Result<Vec<E>, Box<dyn Error>>
pub fn run_event( &self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, state: &S, script: &str, ) -> Result<Vec<E>, Box<dyn Error>>
Run a script and get resulting events
pub fn run_conditional_progress( &self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, script: &str, ) -> ConditionalProgress
pub fn run_currencies_calculate( &self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, script: &str, ) -> Vec<ESCurrencyUnit>
pub fn run_ability_shards_calculate( &self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, script: &str, ) -> Vec<AbilityShard>
pub fn run_description_values_calculate( &self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, script: &str, ability_level: i64, ) -> Vec<f64>
pub fn run_talent_description_values_calculate( &self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, script: &str, talent_level: i64, ) -> Vec<f64>
pub fn run_abilities_ids_script( &self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, script: &str, ) -> Vec<Uuid>
pub fn run_item_ids_script( &self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, script: &str, ) -> Vec<Uuid>
pub fn run_start_cast_ability( &self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, state: S, script: &str, ) -> Result<Vec<StartCastAbilityResult>>
pub fn run_start_cast_projectile( &self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, script: &str, ) -> Result<StartCastProjectileResult>
pub fn run_expression<T: Clone + Send + Sync + 'static>( &self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, script: &str, ) -> Result<T>
pub fn run_party_power_adjust( &self, player_character_state: &CharacterState, party_character_state: &CharacterState, script: &str, ) -> Result<i64>
pub fn calculate_character_power( &self, character_state: &CharacterState, game_config: &GameConfig, ) -> Result<i64>
pub fn calculate_bot_power( &self, bot: &Bot, game_config: &GameConfig, ) -> Result<i64>
pub fn calculate_item_power( &self, item: Item, game_config: &GameConfig, ) -> Result<i64>
pub fn generate_opponent( &self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, character_state: &CharacterState, expected_rating: i64, script: &str, ) -> Result<OpponentGenerationResult>
pub fn generate_test_player( &self, character_state: &CharacterState, script: &str, ) -> Result<TestPlayerResult>
pub fn run_entity_attributes_calculate( &self, scope_setter: impl FnOnce(ScriptScope<'_, E>) -> ScriptScope<'_, E>, script: &str, ) -> AttributeDeltas
pub fn try_get_item_template_id( &self, character_state: &CharacterState, game_config: &GameConfig, ) -> Result<Option<Uuid>>
Trait Implementations§
Auto Trait Implementations§
impl<E, S> !Freeze for ScriptRunner<E, S>
impl<E, S> !RefUnwindSafe for ScriptRunner<E, S>
impl<E, S> Send for ScriptRunner<E, S>
impl<E, S> Sync for ScriptRunner<E, S>
impl<E, S> Unpin for ScriptRunner<E, S>
impl<E, S> !UnwindSafe for ScriptRunner<E, S>
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].