-- FlowChart

FlowChart = {}

function FlowChart:onEvent(aEvent, aParams)
    if aEvent == 'scene.win' then
        fade_panel:fade_out()
        level_mgr:switch_to_level('Map')
        return
    end

    if aEvent == 'level.win' then
        Levels:getLevel(aParams.level):onWin()
        return
    end

    if aEvent == 'minigame.win' then
        fade_panel:fade_out()
        level_mgr:switch_to_level('Map')
        return
    end

    if aEvent == 'minigame.loose' then
        fade_panel:fade_out()
        level_mgr:switch_to_level(aParams.minigame)
        return
    end
end