local this = class("rogueStore", G_BaseStore)
require(L_R.world.rogue .. "rogueConst")
this.event = {
  refreshRogueInfo = "rogueStore_refreshRogueInfo",
  refreshRogueReward = "rogueStore_refreshRogueReward",
  refreshNowEffect = "rogueStore_refreshNowEffect",
  refreshRoomEvent = "rogueStore_refreshRoomEvent",
  refreshRogueStory = "rogueStore_refreshRogueStory",
  showRewardPage = "rogueStore_showRewardPage",
  onRogueSettle = "rogueStore_onRogueSettle",
  refreshExternalData = "rogueStore_refreshExternalData"
}
this:importPartialClass(require(L_R.store .. "rogue.state.rogueState"))
this:importPartialClass(require(L_R.store .. "rogue.state.rogueState_external"))
this:importPartialClass(require(L_R.store .. "rogue.state.rogueState_internal"))
this:importPartialClass(require(L_R.store .. "rogue.action.rogueAction_external"))
this:importPartialClass(require(L_R.store .. "rogue.action.rogueAction_internal"))
this:importPartialClass(require(L_R.store .. "rogue.action.rogueAction_respond"))
this:importPartialClass(require(L_R.store .. "rogue.action.rogueAction_scene"))

function this:resetCurRogue()
  self.data.curRogue = require(L_R.store .. "rogue.data.rogueProgress").new()
end

function this:setRoguePlayerPos(pos, rotate)
  if pos ~= nil then
    self.data.curRogue.pos = pos
  end
  if rotate ~= nil then
    self.data.curRogue.rot = rotate
  end
end

function this:resetPos()
  self.data.curRogue.pos = nil
  self.data.curRogue.rot = nil
end

function this:checkAndStartStory()
  local runningDialog = self:getRunningDialog()
  if not table.isEmpty(runningDialog) then
    self:call(self.event.refreshRogueStory)
  end
end

function this:setDifficulty(difficulty)
  self.data.external.difficulty = difficulty
  self:call(self.event.refreshExternalData)
end

function this:setPlayerInfoGm()
  self.data.playerInfoGm = not self.data.playerInfoGm
  self:call(self.event.refreshRogueInfo)
end

return this
