Example #1
0
/**
 * \brief Constructor.
 * \param hero The hero controlled by this state.
 * \param treasure The treasure to give to the hero. It must be obtainable.
 * \param callback_ref Lua ref to a function to call when the
 * treasure's dialog finishes (possibly LUA_REFNIL).
 */
Hero::TreasureState::TreasureState(
    Hero& hero,
    const Treasure& treasure,
    int callback_ref):

  State(hero, "treasure"),
  treasure(treasure),
  callback_ref(callback_ref) {

  treasure.check_obtainable();
}
Example #2
0
/**
 * \brief Constructor.
 * \param hero The hero controlled by this state.
 * \param treasure The treasure to give to the hero. It must be obtainable.
 * \param callback_ref Lua ref to a function to call when the
 * treasure's dialog finishes (possibly an empty ref).
 */
Hero::TreasureState::TreasureState(
    Hero& hero,
    const Treasure& treasure,
    const ScopedLuaRef& callback_ref
):

  BaseState(hero, "treasure"),
  treasure(treasure),
  callback_ref(callback_ref) {

  treasure.check_obtainable();
}