This commit is contained in:
+49
-3
@@ -25,9 +25,9 @@ use nana_engine::{
|
||||
};
|
||||
use nana_runtime::{
|
||||
AdjudicatingTurnPlanProvider, AdjudicationCatalog, BranchHistoryProjection,
|
||||
LappAdjudicationModel, LappNativeCallGate, LappNativeCallPermit, OpenLappChatExecutor,
|
||||
ProviderError, TurnControl, TurnEngine, TurnPlan, TurnPlanProvider, TurnProjector,
|
||||
load_default_lapp_profile,
|
||||
LappAdjudicationModel, LappNativeCallGate, LappNativeCallPermit, NarrativeCheckpoint,
|
||||
OpenLappChatExecutor, ProviderError, TurnContextPreparation, TurnControl, TurnEngine, TurnPlan,
|
||||
TurnPlanProvider, TurnProjector, load_default_lapp_profile,
|
||||
};
|
||||
use nana_store::{ForkError, SqliteStoryStore, StoreError, StoredBranch, StoryStore};
|
||||
use openlapp::{
|
||||
@@ -395,6 +395,52 @@ impl TurnPlanProvider for RuntimePlanProvider {
|
||||
Self::RetiredTest => Err(ProviderError::Cancelled),
|
||||
}
|
||||
}
|
||||
|
||||
fn uses_context_checkpoints(&self) -> bool {
|
||||
matches!(self, Self::Lapp(provider) if provider.uses_context_checkpoints())
|
||||
}
|
||||
|
||||
fn prepare_turn_context_with_control(
|
||||
&mut self,
|
||||
request: &TurnRequest,
|
||||
state: &RuntimeState,
|
||||
source_nodes: &[StoryNode],
|
||||
expected_history_head_node_id: &str,
|
||||
checkpoint: Option<&NarrativeCheckpoint>,
|
||||
control: &TurnControl,
|
||||
) -> Result<TurnContextPreparation, ProviderError> {
|
||||
match self {
|
||||
Self::Lapp(provider) => provider.prepare_turn_context_with_control(
|
||||
request,
|
||||
state,
|
||||
source_nodes,
|
||||
expected_history_head_node_id,
|
||||
checkpoint,
|
||||
control,
|
||||
),
|
||||
Self::Demo(_) => Ok(TurnContextPreparation::Unmanaged),
|
||||
Self::Unavailable => Err(ProviderError::Configuration { code: None }),
|
||||
#[cfg(test)]
|
||||
Self::RetiredTest => Err(ProviderError::Cancelled),
|
||||
}
|
||||
}
|
||||
|
||||
fn validate_prospective_context_with_control(
|
||||
&mut self,
|
||||
state: &RuntimeState,
|
||||
node: &StoryNode,
|
||||
control: &TurnControl,
|
||||
) -> Result<(), ProviderError> {
|
||||
match self {
|
||||
Self::Lapp(provider) => {
|
||||
provider.validate_prospective_context_with_control(state, node, control)
|
||||
}
|
||||
Self::Demo(_) => Ok(()),
|
||||
Self::Unavailable => Err(ProviderError::Configuration { code: None }),
|
||||
#[cfg(test)]
|
||||
Self::RetiredTest => Err(ProviderError::Cancelled),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl DemoAppState {
|
||||
|
||||
Reference in New Issue
Block a user