
Levels = {}

function Levels:init()

    Levels.items = {}
    Levels.links = {}

    Levels.items[1] = Level:new()
    Levels.items[1]:initLocation('LocConciergeDesk', 1)
    Levels.items[1]:setMinigame('Collapse', {colors = {30, 30}, speed = 1.0, powerups = {}, tutorial = 1}) -- 'bomb', 'color_bomb', 'shuffle', 'freeze'

    Levels.items[2] = Level:new()
    Levels.items[2]:initLocation('LocSupplyCloset', 1)
    Levels.items[2]:initLocation('LocManagersOffice', 2)
    Levels.items[2]:initLocation('LocCourtyard', 4)
    Levels.items[2]:setMinigame('Match2', {layout = 1, tutorial = 1})
    
    Levels.items[3] = Level:new()
    Levels.items[3]:initLocation('LocObservationDeck', 3)
    Levels.items[3]:initLocation('LocMailRoom', 4)
    --Levels.items[3]:setMinigame('TextTwist', {word = "u70u65u67u84u79u82u89", tutorial = 1})

    Levels.items[3]:setCutscene(2)

    Levels.items[4] = Level:new()
    Levels.items[4]:initLocation('LocKitchen', 1)
    Levels.items[4]:initLocation('LocConferenceRoom', 1)
    Levels.items[4]:initLocation('LocBeautySPA', 5)
    Levels.items[4]:setMinigame('Collapse', {colors = {30, 30, 30}, speed = 1.2, powerups = {'bomb'}})

    Levels.items[5] = Level:new()
    Levels.items[5]:initLocation('LocManagersOffice', 3)
    Levels.items[5]:initLocation('LocCourtyard', 1)
    Levels.items[5]:initLocation('LocValetParking', 1)
    Levels.items[5]:setMinigame('Match2', {layout = 3})
   
    Levels.items[6] = Level:new()
    Levels.items[6]:initLocation('LocSupplyCloset', 5)
    Levels.items[6]:initLocation('LocConciergeDesk', 3)
    Levels.items[6]:initLocation('LocObservationDeck', 2)
    Levels.items[6]:initLocation('LocPrivateRoom', 3)
    --Levels.items[6]:setMinigame('TextTwist', { word = "u65u68u86u73u83u69u82" })

    Levels.items[6]:setCutscene(3)

    Levels.items[7] = Level:new()
    Levels.items[7]:initLocation('LocGym', 1)
    Levels.items[7]:initLocation('LocSupplyCloset', 2)
    Levels.items[7]:initLocation('LocManagersOffice', 4)
    Levels.items[7]:setMinigame('Collapse', {colors = {40, 40, 40}, speed = 1.2, powerups = {'bomb'}})
    
    Levels.items[8] = Level:new()
    Levels.items[8]:initLocation('LocNightClub', 1)
    Levels.items[8]:initLocation('LocSwimmingPool', 1)
    Levels.items[8]:initLocation('LocMailRoom', 3)
    Levels.items[8]:initLocation('LocBeautySPA', 3)
    Levels.items[8]:setMinigame('Match2', {layout = 4})

    Levels.items[9] = Level:new()
    Levels.items[9]:initLocation('LocCoffeshop', 1)
    Levels.items[9]:initLocation('LocSecurityStation', 1)
    Levels.items[9]:initLocation('LocExecutiveWashroom', 1)
    Levels.items[9]:initLocation('LocSwimmingPool', 2)
    Levels.items[9]:initLocation('LocConciergeDesk', 5)
    --Levels.items[9]:setMinigame('TextTwist', { word = "u65u76u73u71u78u69u68" })

    Levels.items[9]:setCutscene(4)

    Levels.items[10] = Level:new()
    Levels.items[10]:initLocation('LocNightClub', 3)
    Levels.items[10]:initLocation('LocCoffeshop', 2)
    Levels.items[10]:initLocation('LocWinterGarden', 1)
    Levels.items[10]:initLocation('LocTailor', 5)
    Levels.items[10]:setMinigame('Collapse', {colors = {40, 40, 40, 40}, speed = 1.2, powerups = {'bomb', 'color_bomb'}})

    Levels.items[11] = Level:new()
    Levels.items[11]:initLocation('LocPrivateRoom', 2)
    Levels.items[11]:initLocation('LocSecurityStation', 4)
    Levels.items[11]:initLocation('LocSwimmingPool', 5)
    Levels.items[11]:initLocation('LocKitchen', 3)
    Levels.items[11]:initLocation('LocValetParking', 3)
    Levels.items[11]:setMinigame('Match2', {layout = 6})

    Levels.items[12] = Level:new()
    Levels.items[12]:initLocation('LocLaundry', 1)
    Levels.items[12]:initLocation('LocSupplyCloset', 3)
    Levels.items[12]:initLocation('LocTailor', 4)
    --Levels.items[12]:setMinigame('TextTwist', { word = "u65u76u73u77u79u78u89" })

    Levels.items[12]:setCutscene(5)

    Levels.items[13] = Level:new()
    Levels.items[13]:initLocation('LocMailRoom', 5)
    Levels.items[13]:initLocation('LocConferenceRoom', 2)
    Levels.items[13]:initLocation('LocNightClub', 4)
    Levels.items[13]:initLocation('LocGym', 4)
    Levels.items[13]:setMinigame('Collapse', {colors = {50, 50, 50, 50}, speed = 1.2, powerups = {'bomb', 'color_bomb'}}) 

    Levels.items[14] = Level:new()
    Levels.items[14]:initLocation('LocWinterGarden', 3)
    Levels.items[14]:initLocation('LocCourtyard', 2)
    Levels.items[14]:initLocation('LocExecutiveWashroom', 3)
    Levels.items[14]:initLocation('LocManagersOffice', 5)
    Levels.items[14]:initLocation('LocKitchen', 5)
    Levels.items[14]:setMinigame('Match2', {layout = 7})

    Levels.items[15] = Level:new()
    Levels.items[15]:initLocation('LocNightClub', 5)
    Levels.items[15]:initLocation('LocObservationDeck', 4)
    Levels.items[15]:initLocation('LocBeautySPA', 4)
    Levels.items[15]:initLocation('LocTailor', 3)
    --Levels.items[15]:setMinigame('TextTwist', { word = "u65u76u77u79u78u68u83" })

    Levels.items[15]:setCutscene(6)

    Levels.items[16] = Level:new()
    Levels.items[16]:initLocation('LocKitchen', 2)
    Levels.items[16]:initLocation('LocLaundry', 3)
    Levels.items[16]:initLocation('LocPrivateRoom', 1)
    Levels.items[16]:setMinigame('Collapse', {colors = {50, 50, 50, 50, 50}, speed = 1.2, powerups = {'bomb', 'color_bomb', 'shuffle'}})

    Levels.items[17] = Level:new()
    Levels.items[17]:initLocation('LocSwimmingPool', 4)
    Levels.items[17]:initLocation('LocConferenceRoom', 3)
    Levels.items[17]:initLocation('LocSupplyCloset', 4)
    Levels.items[17]:initLocation('LocManagersOffice', 1)
    Levels.items[17]:setMinigame('Match2', {layout = 9})

    Levels.items[18] = Level:new()
    Levels.items[18]:initLocation('LocCoffeshop', 3)
    Levels.items[18]:initLocation('LocBeautySPA', 1)
    Levels.items[18]:initLocation('LocGym', 3)
    Levels.items[18]:initLocation('LocValetParking', 4)
    Levels.items[18]:initLocation('LocWinterGarden', 2)
    --Levels.items[18]:setMinigame('TextTwist', { word = "u65u78u67u73u69u78u84" })

    Levels.items[18]:setCutscene(7)

    Levels.items[19] = Level:new()
    Levels.items[19]:initLocation('LocObservationDeck', 1)
    Levels.items[19]:initLocation('LocCourtyard', 5)
    Levels.items[19]:initLocation('LocWinterGarden', 4)
    Levels.items[19]:initLocation('LocPrivateRoom', 4)
    Levels.items[19]:setMinigame('Match2', {layout = 10})

    Levels.items[20] = Level:new()
    Levels.items[20]:initLocation('LocLaundry', 5)
    Levels.items[20]:initLocation('LocCoffeshop', 5)
    Levels.items[20]:initLocation('LocCourtyard', 3)
    Levels.items[20]:initLocation('LocSecurityStation', 5)
    Levels.items[20]:initLocation('LocExecutiveWashroom', 4)
    Levels.items[20]:setMinigame('Collapse', {colors = {60, 60, 60, 60, 60}, speed = 1.2, powerups = {'bomb', 'color_bomb', 'shuffle'}})

    Levels.items[21] = Level:new()
    Levels.items[21]:initLocation('LocGym', 2)
    Levels.items[21]:initLocation('LocSecurityStation', 3)
    Levels.items[21]:initLocation('LocSwimmingPool', 3)
    --Levels.items[21]:setMinigame('TextTwist', { word = "u65u78u84u73u81u85u69" })

    Levels.items[21]:setCutscene(8)

    Levels.items[22] = Level:new()
    Levels.items[22]:initLocation('LocValetParking', 5)
    Levels.items[22]:initLocation('LocConferenceRoom', 5)
    Levels.items[22]:initLocation('LocConciergeDesk', 4)
    Levels.items[22]:initLocation('LocPrivateRoom', 5)
    Levels.items[22]:setMinigame('Collapse', {colors = {60, 60, 60, 60, 60, 60}, speed = 1.2, powerups = {'bomb', 'color_bomb', 'shuffle', 'freeze'}})

    Levels.items[23] = Level:new()
    Levels.items[23]:initLocation('LocMailRoom', 1)
    Levels.items[23]:initLocation('LocLaundry', 4)
    Levels.items[23]:initLocation('LocNightClub', 2)
    Levels.items[23]:setMinigame('Match2', {layout = 8})

    Levels.items[24] = Level:new()
    Levels.items[24]:initLocation('LocExecutiveWashroom', 2)
    Levels.items[24]:initLocation('LocSecurityStation', 2)
    Levels.items[24]:initLocation('LocValetParking', 2)
    Levels.items[24]:initLocation('LocGym', 5)
    --Levels.items[24]:setMinigame('TextTwist', { word = "u65u83u80u73u82u69u83" })

    Levels.items[24]:setCutscene(9)

    Levels.items[25] = Level:new()
    Levels.items[25]:initLocation('LocConferenceRoom', 4)
    Levels.items[25]:initLocation('LocBeautySPA', 2)
    Levels.items[25]:initLocation('LocLaundry', 2)
    Levels.items[25]:initLocation('LocTailor', 1)
    Levels.items[25]:setMinigame('Match2', {layout = 7})

    Levels.items[26] = Level:new()
    Levels.items[26]:initLocation('LocWinterGarden', 5)
    Levels.items[26]:initLocation('LocObservationDeck', 5)
    Levels.items[26]:initLocation('LocKitchen', 4)
    Levels.items[26]:initLocation('LocCoffeshop', 4)
    Levels.items[26]:initLocation('LocMailRoom', 2)
    Levels.items[26]:setMinigame('Collapse', {colors = {70, 70, 70, 70, 70, 70}, speed = 1.2, powerups = {'bomb', 'color_bomb', 'shuffle', 'freeze'}})

    Levels.items[27] = Level:new()
    Levels.items[27]:initLocation('LocConciergeDesk', 2)
    Levels.items[27]:initLocation('LocTailor', 2)
    Levels.items[27]:initLocation('LocExecutiveWashroom', 5)
    --Levels.items[27]:setMinigame('TextTwist', { word = "u66u65u84u84u76u69u83" })

    Levels.items[27]:setCutscene(10)

    Levels.items[28] = Level:new()
--[[    Levels.items[28]:initLocation('LocLaundry', 1)

    Levels.items[29] = Level:new()
    Levels.items[29]:initLocation('LocValetParking', 3)

    Levels.items[30] = Level:new()
    Levels.items[30]:initLocation('LocValetParking', 4)

    Levels.items[31] = Level:new()
    Levels.items[31]:initLocation('LocValetParking', 5)

    Levels.items[32] = Level:new()
    Levels.items[32]:initLocation('LocValetParking', 2)

    Levels.items[33] = Level:new()]]


end

function Levels:reset()
    Levels:init()
end

function Levels:getLevel(aIndex)
    return Levels.items[aIndex]
end

function Levels:getCurrentLevel()
    return Levels.items[Profile:getLevel()]
end

function Levels:getCount()
    return #Levels.items
end

function Levels:getLevelFromScene(location, scene)
    return Levels.items[ Levels.links[location][scene] ]
end
