28 lines
964 B
Rust
28 lines
964 B
Rust
use super::*;
|
|
use crate::mapper::*;
|
|
|
|
impl SpacetimeClient {
|
|
pub async fn resolve_npc_battle_interaction(
|
|
&self,
|
|
input: crate::mapper::ResolveNpcBattleInteractionInput,
|
|
) -> Result<NpcBattleInteractionRecord, SpacetimeClientError> {
|
|
validate_npc_battle_interaction_input(&input)?;
|
|
let procedure_input = input.into();
|
|
|
|
self.call_after_connect(move |connection, sender| {
|
|
connection
|
|
.procedures()
|
|
.resolve_npc_battle_interaction_and_return_then(
|
|
procedure_input,
|
|
move |_, result| {
|
|
let mapped = result
|
|
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
|
|
.and_then(map_npc_battle_interaction_procedure_result);
|
|
send_once(&sender, mapped);
|
|
},
|
|
);
|
|
})
|
|
.await
|
|
}
|
|
}
|