// AUTO-GENERATED FILE - DO NOT EDIT
// Generated by tools/story_gen/story_gen.py
// spec_hash: 4146e7c78895
// scenarios: 4

#include "scenarios_gen.h"

#include <cstring>

namespace {
constexpr const char* kSc0St0Actions[] = {
    "ACTION_TRACE_STEP",
};
constexpr const char* kSc0St0Apps[] = {
    "APP_LA",
    "APP_SCREEN",
    "APP_GATE",
};
constexpr TransitionDef kSc0St0Transitions[] = {
    {"TR_STEP_WAIT_UNLOCK_1", StoryTransitionTrigger::kOnEvent, StoryEventType::kUnlock, "UNLOCK", 0U, "STEP_WIN", 100U},
};
constexpr const char* kSc0St1Actions[] = {
    "ACTION_TRACE_STEP",
};
constexpr const char* kSc0St1Apps[] = {
    "APP_AUDIO",
    "APP_SCREEN",
    "APP_GATE",
};
constexpr TransitionDef kSc0St1Transitions[] = {
    {"TR_STEP_WIN_1", StoryTransitionTrigger::kOnEvent, StoryEventType::kAudioDone, "AUDIO_DONE", 0U, "STEP_WAIT_ETAPE2", 100U},
    {"TR_STEP_WIN_2", StoryTransitionTrigger::kOnEvent, StoryEventType::kSerial, "FORCE_ETAPE2", 0U, "STEP_ETAPE2", 120U},
};
constexpr const char* kSc0St2Actions[] = {
    "ACTION_TRACE_STEP",
};
constexpr const char* kSc0St2Apps[] = {
    "APP_SCREEN",
    "APP_GATE",
};
constexpr TransitionDef kSc0St2Transitions[] = {
    {"TR_STEP_WAIT_ETAPE2_1", StoryTransitionTrigger::kOnEvent, StoryEventType::kTimer, "ETAPE2_DUE", 0U, "STEP_ETAPE2", 100U},
    {"TR_STEP_WAIT_ETAPE2_2", StoryTransitionTrigger::kOnEvent, StoryEventType::kSerial, "FORCE_ETAPE2", 0U, "STEP_ETAPE2", 120U},
};
constexpr const char* kSc0St3Actions[] = {
    "ACTION_TRACE_STEP",
};
constexpr const char* kSc0St3Apps[] = {
    "APP_AUDIO",
    "APP_SCREEN",
    "APP_GATE",
};
constexpr TransitionDef kSc0St3Transitions[] = {
    {"TR_STEP_ETAPE2_1", StoryTransitionTrigger::kOnEvent, StoryEventType::kAudioDone, "AUDIO_DONE", 0U, "STEP_DONE", 100U},
    {"TR_STEP_ETAPE2_2", StoryTransitionTrigger::kOnEvent, StoryEventType::kSerial, "FORCE_DONE", 0U, "STEP_DONE", 120U},
};
constexpr const char* kSc0St4Actions[] = {
    "ACTION_TRACE_STEP",
    "ACTION_REFRESH_SD",
};
constexpr const char* kSc0St4Apps[] = {
    "APP_SCREEN",
    "APP_GATE",
};

constexpr StepDef kScenario0Steps[] = {
    {"STEP_WAIT_UNLOCK", {"SCENE_LOCKED", nullptr, kSc0St0Actions, 1U, kSc0St0Apps, 3U}, kSc0St0Transitions, 1U, true},
    {"STEP_WIN", {"SCENE_REWARD", "PACK_WIN", kSc0St1Actions, 1U, kSc0St1Apps, 3U}, kSc0St1Transitions, 2U, false},
    {"STEP_WAIT_ETAPE2", {"SCENE_LOCKED", nullptr, kSc0St2Actions, 1U, kSc0St2Apps, 2U}, kSc0St2Transitions, 2U, false},
    {"STEP_ETAPE2", {"SCENE_REWARD", "PACK_ETAPE2", kSc0St3Actions, 1U, kSc0St3Apps, 3U}, kSc0St3Transitions, 2U, false},
    {"STEP_DONE", {"SCENE_READY", nullptr, kSc0St4Actions, 2U, kSc0St4Apps, 2U}, nullptr, 0U, true},
};

constexpr ScenarioDef kScenario0 = {
    "DEFAULT",
    2U,
    kScenario0Steps,
    5U,
    "STEP_WAIT_UNLOCK",
};

constexpr const char* kSc1St0Actions[] = {
    "ACTION_TRACE_STEP",
};
constexpr const char* kSc1St0Apps[] = {
    "APP_LA",
    "APP_SCREEN",
    "APP_GATE",
};
constexpr TransitionDef kSc1St0Transitions[] = {
    {"TR_STEP_WAIT_UNLOCK_1", StoryTransitionTrigger::kOnEvent, StoryEventType::kUnlock, "UNLOCK", 0U, "STEP_WIN", 100U},
};
constexpr const char* kSc1St1Actions[] = {
    "ACTION_TRACE_STEP",
};
constexpr const char* kSc1St1Apps[] = {
    "APP_AUDIO",
    "APP_SCREEN",
    "APP_GATE",
};
constexpr TransitionDef kSc1St1Transitions[] = {
    {"TR_STEP_WIN_1", StoryTransitionTrigger::kOnEvent, StoryEventType::kAudioDone, "AUDIO_DONE", 0U, "STEP_DONE", 100U},
    {"TR_STEP_WIN_2", StoryTransitionTrigger::kOnEvent, StoryEventType::kSerial, "FORCE_DONE", 0U, "STEP_DONE", 120U},
};
constexpr const char* kSc1St2Actions[] = {
    "ACTION_TRACE_STEP",
    "ACTION_REFRESH_SD",
};
constexpr const char* kSc1St2Apps[] = {
    "APP_SCREEN",
    "APP_GATE",
};

constexpr StepDef kScenario1Steps[] = {
    {"STEP_WAIT_UNLOCK", {"SCENE_LOCKED", nullptr, kSc1St0Actions, 1U, kSc1St0Apps, 3U}, kSc1St0Transitions, 1U, false},
    {"STEP_WIN", {"SCENE_REWARD", "PACK_WIN", kSc1St1Actions, 1U, kSc1St1Apps, 3U}, kSc1St1Transitions, 2U, false},
    {"STEP_DONE", {"SCENE_READY", nullptr, kSc1St2Actions, 2U, kSc1St2Apps, 2U}, nullptr, 0U, true},
};

constexpr ScenarioDef kScenario1 = {
    "EXAMPLE_UNLOCK_EXPRESS",
    2U,
    kScenario1Steps,
    3U,
    "STEP_WAIT_UNLOCK",
};

constexpr const char* kSc2St0Actions[] = {
    "ACTION_TRACE_STEP",
};
constexpr const char* kSc2St0Apps[] = {
    "APP_LA",
    "APP_SCREEN",
    "APP_GATE",
};
constexpr TransitionDef kSc2St0Transitions[] = {
    {"TR_STEP_WAIT_UNLOCK_1", StoryTransitionTrigger::kOnEvent, StoryEventType::kUnlock, "UNLOCK", 0U, "STEP_WIN", 100U},
};
constexpr const char* kSc2St1Actions[] = {
    "ACTION_TRACE_STEP",
};
constexpr const char* kSc2St1Apps[] = {
    "APP_AUDIO",
    "APP_SCREEN",
    "APP_GATE",
};
constexpr TransitionDef kSc2St1Transitions[] = {
    {"TR_STEP_WIN_1", StoryTransitionTrigger::kOnEvent, StoryEventType::kAudioDone, "AUDIO_DONE", 0U, "STEP_DONE", 100U},
};
constexpr const char* kSc2St2Actions[] = {
    "ACTION_TRACE_STEP",
    "ACTION_REFRESH_SD",
};
constexpr const char* kSc2St2Apps[] = {
    "APP_SCREEN",
    "APP_GATE",
};

constexpr StepDef kScenario2Steps[] = {
    {"STEP_WAIT_UNLOCK", {"SCENE_LOCKED", nullptr, kSc2St0Actions, 1U, kSc2St0Apps, 3U}, kSc2St0Transitions, 1U, false},
    {"STEP_WIN", {"SCENE_REWARD", "PACK_WIN", kSc2St1Actions, 1U, kSc2St1Apps, 3U}, kSc2St1Transitions, 1U, false},
    {"STEP_DONE", {"SCENE_READY", nullptr, kSc2St2Actions, 2U, kSc2St2Apps, 2U}, nullptr, 0U, true},
};

constexpr ScenarioDef kScenario2 = {
    "EXEMPLE_UNLOCK_EXPRESS_DONE",
    2U,
    kScenario2Steps,
    3U,
    "STEP_WAIT_UNLOCK",
};

constexpr const char* kSc3St0Actions[] = {
    "ACTION_TRACE_STEP",
    "ACTION_QUEUE_SONAR",
};
constexpr const char* kSc3St0Apps[] = {
    "APP_LA",
    "APP_SCREEN",
    "APP_GATE",
};
constexpr TransitionDef kSc3St0Transitions[] = {
    {"TR_STEP_WAIT_UNLOCK_1", StoryTransitionTrigger::kOnEvent, StoryEventType::kUnlock, "UNLOCK", 0U, "STEP_SONAR_SEARCH", 100U},
};
constexpr const char* kSc3St1Actions[] = {
    "ACTION_TRACE_STEP",
};
constexpr const char* kSc3St1Apps[] = {
    "APP_AUDIO",
    "APP_SCREEN",
    "APP_GATE",
};
constexpr TransitionDef kSc3St1Transitions[] = {
    {"TR_STEP_SONAR_SEARCH_1", StoryTransitionTrigger::kOnEvent, StoryEventType::kAudioDone, "AUDIO_DONE", 0U, "STEP_MORSE_CLUE", 100U},
    {"TR_STEP_SONAR_SEARCH_2", StoryTransitionTrigger::kOnEvent, StoryEventType::kSerial, "FORCE_DONE", 0U, "STEP_DONE", 120U},
};
constexpr const char* kSc3St2Actions[] = {
    "ACTION_TRACE_STEP",
};
constexpr const char* kSc3St2Apps[] = {
    "APP_AUDIO",
    "APP_SCREEN",
    "APP_GATE",
};
constexpr TransitionDef kSc3St2Transitions[] = {
    {"TR_STEP_MORSE_CLUE_1", StoryTransitionTrigger::kOnEvent, StoryEventType::kAudioDone, "AUDIO_DONE", 0U, "STEP_WIN", 100U},
    {"TR_STEP_MORSE_CLUE_2", StoryTransitionTrigger::kOnEvent, StoryEventType::kSerial, "FORCE_DONE", 0U, "STEP_DONE", 120U},
};
constexpr const char* kSc3St3Actions[] = {
    "ACTION_TRACE_STEP",
};
constexpr const char* kSc3St3Apps[] = {
    "APP_AUDIO",
    "APP_SCREEN",
    "APP_GATE",
};
constexpr TransitionDef kSc3St3Transitions[] = {
    {"TR_STEP_WIN_1", StoryTransitionTrigger::kOnEvent, StoryEventType::kAudioDone, "AUDIO_DONE", 0U, "STEP_DONE", 100U},
    {"TR_STEP_WIN_2", StoryTransitionTrigger::kOnEvent, StoryEventType::kSerial, "FORCE_DONE", 0U, "STEP_DONE", 120U},
};
constexpr const char* kSc3St4Actions[] = {
    "ACTION_TRACE_STEP",
    "ACTION_REFRESH_SD",
};
constexpr const char* kSc3St4Apps[] = {
    "APP_SCREEN",
    "APP_GATE",
};

constexpr StepDef kScenario3Steps[] = {
    {"STEP_WAIT_UNLOCK", {"SCENE_LOCKED", nullptr, kSc3St0Actions, 2U, kSc3St0Apps, 3U}, kSc3St0Transitions, 1U, false},
    {"STEP_SONAR_SEARCH", {"SCENE_SEARCH", "PACK_SONAR_HINT", kSc3St1Actions, 1U, kSc3St1Apps, 3U}, kSc3St1Transitions, 2U, false},
    {"STEP_MORSE_CLUE", {"SCENE_SEARCH", "PACK_MORSE_HINT", kSc3St2Actions, 1U, kSc3St2Apps, 3U}, kSc3St2Transitions, 2U, false},
    {"STEP_WIN", {"SCENE_REWARD", "PACK_WIN", kSc3St3Actions, 1U, kSc3St3Apps, 3U}, kSc3St3Transitions, 2U, false},
    {"STEP_DONE", {"SCENE_READY", nullptr, kSc3St4Actions, 2U, kSc3St4Apps, 2U}, nullptr, 0U, true},
};

constexpr ScenarioDef kScenario3 = {
    "SPECTRE_RADIO_LAB",
    1U,
    kScenario3Steps,
    5U,
    "STEP_WAIT_UNLOCK",
};

constexpr const ScenarioDef* kGeneratedScenarios[] = {
    &kScenario0,
    &kScenario1,
    &kScenario2,
    &kScenario3,
};

}  // namespace

const ScenarioDef* generatedScenarioById(const char* id) {
  if (id == nullptr || id[0] == '\0') {
    return generatedScenarioDefault();
  }
  for (const ScenarioDef* scenario : kGeneratedScenarios) {
    if (scenario != nullptr && scenario->id != nullptr && strcmp(scenario->id, id) == 0) {
      return scenario;
    }
  }
  return nullptr;
}

const ScenarioDef* generatedScenarioDefault() {
  return (generatedScenarioCount() == 0U) ? nullptr : kGeneratedScenarios[0];
}

uint8_t generatedScenarioCount() {
  return static_cast<uint8_t>(sizeof(kGeneratedScenarios) / sizeof(kGeneratedScenarios[0]));
}

const char* generatedScenarioIdAt(uint8_t index) {
  if (index >= generatedScenarioCount()) {
    return nullptr;
  }
  const ScenarioDef* scenario = kGeneratedScenarios[index];
  return (scenario != nullptr) ? scenario->id : nullptr;
}

const char* generatedScenarioSpecHash() {
  return "4146e7c78895";
}

