﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BrawlManagerLib {
	public static class SongIDMap {
		public static IEnumerable<Song> Songs {
			get {
				return allSongs;
			}
		}

		private static Song[] allSongs;

		static SongIDMap() {
			allSongs = new Song[ushort.MaxValue + 1];
			for (int i = 0; i == (ushort)i; i++) {
				allSongs[i] = existing.FirstOrDefault(s => s.ID == i) ?? customSoundEngineSong(i);
			}
		}

		private static Song customSoundEngineSong(int id) {
			return new Song(
				"Custom Sound Engine: " + id.ToString("X4"),
				id.ToString("X8"),
				(ushort)id,
				null,
				null
			);
		}

		private static Song[] existing = {
			new Song("", "", 0xFFFF, null, null),
			new Song("Super Smash Bros. Brawl Main Theme", "X01", 0x26F9, 80, 0),
			new Song("Menu 1", "X02", 0x26FA, 70, 111),
			new Song("Menu 2", "X03", 0x26FB, 75, 188),
			new Song("Battlefield", "X04", 0x26FC, 80, 199),
			new Song("Final Destination", "X05", 0x26FD, 80, 221),
			new Song("Classic mode clear [NAMELESS]", "X06", 0x26FE, null, null),
			new Song("Online Practice Stage", "X07", 0x26FF, null, 232),
			new Song("Results Display Screen", "X08", 0x2700, null, 243),
			new Song("Tournament Registration", "X09", 0x2701, null, 254),
			new Song("Tournament Grid", "X10", 0x2702, null, 1),
			new Song("Tournament Match End", "X11", 0x2703, null, 12),
			new Song("Classic: Results Screen", "X13", 0x2705, null, 23),
			new Song("All-Star Rest Area", "X15", 0x2707, null, 34),
			new Song("Home-Run Contest", "X16", 0x2708, null, 45),
			new Song("Cruel Brawl", "X17", 0x2709, null, 184),
			new Song("Boss Battle", "X18", 0x270A, null, 56),
			new Song("Trophy Gallery", "X19", 0x270B, null, 67),
			new Song("Sticker Album / Album / Chronicle", "X20", 0x270C, null, 78),
			new Song("Coin Launcher", "X21", 0x270D, null, 89),
			new Song("Classic mode clear - trophy [NAMELESS]", "X22", 0x270E, null, null),
			new Song("Stage Builder", "X23", 0x270F, null, 100),
			new Song("Battlefield Ver. 2", "X25", 0x2711, 70, 210),
			new Song("Target Smash!!", "X26", 0x2712, null, 112),
			new Song("Credits", "X27", 0x2713, null, 189),
			new Song("Ground Theme (Super Mario Bros.)", "A01", 0x2714, 80, 231),
			new Song("Underground Theme (Super Mario Bros.)", "A02", 0x2715, 80, 235),
			new Song("Underwater Theme (Super Mario Bros.)", "A03", 0x2716, 80, 236),
			new Song("Underground Theme (Super Mario Land)", "A04", 0x2717, 80, 237),
			new Song("Airship Theme (Super Mario Bros. 3)", "A05", 0x2718, 85, 240),
			new Song("Castle / Boss Fortress (Super Mario World / SMB 3)", "A06", 0x2719, 80, 239),
			new Song("Title / Ending (Super Mario World)", "A07", 0x271A, 80, 227),
			new Song("Main Theme (New Super Mario Bros.)", "A08", 0x271B, 85, 228),
			new Song("Luigi's Mansion Theme", "A09", 0x271C, 80, 238),
			new Song("Gritzy Desert", "A10", 0x271D, 80, 234),
			new Song("Delfino Plaza", "A13", 0x2720, 80, 226),
			new Song("Ricco Harbor", "A14", 0x2721, 96, 229),
			new Song("Main Theme (Super Mario 64)", "A15", 0x2722, 80, 230),
			new Song("Ground Theme 2 (Super Mario Bros.)", "A16", 0x2723, 80, 233),
			new Song("Mario Bros.", "A17", 0x2724, 80, 127),
			new Song("Mario Circuit", "A20", 0x2725, 80, 241),
			new Song("Luigi Circuit", "A21", 0x2726, 80, 242),
			new Song("Waluigi Pinball", "A22", 0x2727, 80, 244),
			new Song("Rainbow Road", "A23", 0x2728, 80, 245),
			new Song("Jungle Level Ver.2", "B01", 0x2729, 85, 246),
			new Song("The Map Page / Bonus Level", "B02", 0x272A, 85, 252),
			new Song("Opening (Donkey Kong)", "B03", 0x272B, 85, 255),
			new Song("Donkey Kong", "B04", 0x272C, 85, 253),
			new Song("King K.Rool / Ship Deck 2", "B05", 0x272D, 80, 248),
			new Song("Bramble Blast", "B06", 0x272E, 85, 249),
			new Song("Battle for Storm Hill", "B07", 0x272F, 75, 250),
			new Song("Jungle Level", "B08", 0x2730, 85, 247),
			new Song("25m BGM", "B09", 0x2731, 80, 256),
			new Song("DK Jungle 1 Theme (Barrel Blast)", "B10", 0x2732, 75, 251),
			new Song("Title (The Legend of Zelda)", "C01", 0x2733, 75, 259),
			new Song("Main Theme (The Legend of Zelda)", "C02", 0x2734, 70, 257),
			new Song("Great Temple / Temple", "C03", 0x2735, 80, 3),
			new Song("The Dark World", "C04", 0x2736, 95, 260),
			new Song("Hidden Mountain & Forest", "C05", 0x2737, 80, 261),
			new Song("Tal Tal Heights", "C07", 0x2739, 85, 6),
			new Song("Hyrule Field Theme", "C08", 0x273A, 80, 262),
			new Song("Ocarina of Time Medley", "C09", 0x273B, 80, 258),
			new Song("Song of Storms", "C10", 0x273C, 80, 7),
			new Song("Molgera Battle", "C11", 0x273D, 85, 9),
			new Song("Village of the Blue Maiden", "C12", 0x273E, 80, 10),
			new Song("Gerudo Valley", "C13", 0x273F, 80, 8),
			new Song("Termina Field", "C14", 0x2740, 90, 11),
			new Song("Dragon Roost Island", "C15", 0x2741, 80, 4),
			new Song("The Great Sea", "C16", 0x2742, 80, 5),
			new Song("Main Theme (Twilight Princess)", "C17", 0x2743, 80, 263),
			new Song("The Hidden Village", "C18", 0x2744, 80, 264),
			new Song("Midna's Lament", "C19", 0x2745, 80, 2),
			new Song("Main Theme (Metroid)", "D01", 0x2746, 80, 13),
			new Song("Norfair", "D02", 0x2747, 80, 15),
			new Song("Ending (Metroid)", "D03", 0x2748, 70, 14),
			new Song("Vs. Ridley", "D04", 0x2749, 80, 17),
			new Song("Theme of Samus Aran, Space Warrior", "D05", 0x274A, 95, 16),
			new Song("Sector 1", "D06", 0x274B, 90, 20),
			new Song("Opening / Menu (Metroid Prime)", "D07", 0x274C, 80, 19),
			new Song("Vs. Parasite Queen", "D08", 0x274D, 80, 18),
			new Song("Vs. Meta Ridley", "D09", 0x274E, 90, 21),
			new Song("Multiplayer (Metroid Prime 2)", "D10", 0x274F, 75, 22),
			new Song("Ending (Yoshi's Story)", "E01", 0x2750, 85, 25),
			new Song("Obstacle Course", "E02", 0x2751, 80, 24),
			new Song("Yoshi's Island", "E03", 0x2752, 80, 26),
			new Song("Flower Field", "E05", 0x2754, 80, 27),
			new Song("Wildlands", "E06", 0x2755, 80, 28),
			new Song("The Legendary Air Ride Machine", "F01", 0x2757, null, 30),
			new Song("King Dedede's Theme", "F02", 0x2758, null, 33),
			new Song("Boss Theme Medley", "F03", 0x2759, null, 38),
			new Song("Butter Building", "F04", 0x275A, null, 32),
			new Song("Gourmet Race", "F05", 0x275B, null, 31),
			new Song("Meta Knight's Revenge", "F06", 0x275C, null, 29),
			new Song("Vs. Marx", "F07", 0x275D, null, 36),
			new Song("02 Battle", "F08", 0x275E, null, 37),
			new Song("Forest / Nature Area", "F09", 0x275F, null, 40),
			new Song("Checker Knights", "F10", 0x2760, null, 39),
			new Song("Frozen Hillside", "F11", 0x2761, null, 41),
			new Song("Squeak Squad Theme", "F12", 0x2762, null, 35),
			new Song("Main Theme (Star Fox)", "G01", 0x2763, 80, 44),
			new Song("Corneria", "G02", 0x2764, 85, 43),
			new Song("Main Theme (Star Fox 64)", "G03", 0x2765, 70, 46),
			new Song("Area 6", "G04", 0x2766, 80, 47),
			new Song("Star Wolf", "G05", 0x2767, 80, 49),
			new Song("Space Battleground", "G07", 0x2769, 80, 51),
			new Song("Break Through the Ice", "G08", 0x276A, 80, 52),
			new Song("Star Wolf (Star Fox: Assault)", "G09", 0x276B, 80, 50),
			new Song("Space Armada", "G10", 0x276C, 80, 42),
			new Song("Area 6 Ver. 2", "G11", 0x276D, 80, 48),
			new Song("Pokémon Main Theme", "H01", 0x276E, 80, 53),
			new Song("Pokémon Center", "H02", 0x276F, 80, 55),
			new Song("Road to Viridian City (From Pallet Town / Pewter City)", "H03", 0x2770, 70, 54),
			new Song("Pokémon Gym / Evolution", "H04", 0x2771, 73, 57),
			new Song("Wild Pokémon Battle! (Ruby / Sapphire)", "H05", 0x2772, 80, 58),
			new Song("Victory Road", "H06", 0x2773, 80, 59),
			new Song("Wild Pokémon Battle! (Diamond / Pearl)", "H07", 0x2774, 85, 61),
			new Song("Dialga / Palkia Battle at Spear Pillar!", "H08", 0x2775, 80, 60),
			new Song("Team Galactic Battle!", "H09", 0x2776, 80, 62),
			new Song("Route 209", "H10", 0x2777, 80, 63),
			new Song("Mute City", "I01", 0x2778, 80, 64),
			new Song("White Land", "I02", 0x2779, 70, 66),
			new Song("Fire Field", "I03", 0x277A, 75, 65),
			new Song("Car Select", "I04", 0x277B, 90, 68),
			new Song("Dream Chaser", "I05", 0x277C, 85, 69),
			new Song("Devil's Call in Your Heart", "I06", 0x277D, 80, 70),
			new Song("Climb Up! And Get The Last Chance!", "I07", 0x277E, 85, 71),
			new Song("Brain Cleaner", "I08", 0x277F, 80, 72),
			new Song("Shotgun Kiss", "I09", 0x2780, 80, 73),
			new Song("Planet Colors", "I10", 0x2781, 80, 74),
			new Song("Fire Emblem Theme", "J02", 0x2783, 110, 82),
			new Song("Shadow Dragon Medley", "J03", 0x2784, 80, 87),
			new Song("With Mila's Divine Protection (Celica Map 1)", "J04", 0x2785, 80, 83),
			new Song("Preparing to Advance", "J06", 0x2787, 80, 85),
			new Song("Winning Road - Roy's Hope", "J07", 0x2788, 80, 86),
			new Song("Attack", "J08", 0x2789, 80, 84),
			new Song("Against the Dark Knight", "J09", 0x278A, 75, 90),
			new Song("Crimean Army Sortie", "J10", 0x278B, 80, 91),
			new Song("Power-Hungry Fool", "J11", 0x278C, 80, 92),
			new Song("Victory Is Near", "J12", 0x278D, 80, 93),
			new Song("Ike's Theme", "J13", 0x278E, 80, 88),
			new Song("Snowman", "K01", 0x278F, 85, 81),
			new Song("Humoresque of a Little Dog", "K05", 0x2793, 85, 80),
			new Song("Porky's Theme", "K07", 0x2795, 80, 75),
			new Song("Mother 3 Love Theme", "K08", 0x2796, 80, 77),
			new Song("Unfounded Revenge / Smashing Song of Praise", "K09", 0x2797, 80, 76),
			new Song("You Call This a Utopia?!", "K10", 0x2798, 90, 79),
			new Song("World Map (Pikmin 2)", "L01", 0x2799, 80, 108),
			new Song("Forest of Hope", "L02", 0x279A, 90, 110),
			new Song("Environmental Noises", "L03", 0x279B, 80, 116),
			new Song("Ai no Uta", "L04", 0x279C, 70, 113),
			new Song("Tane no Uta", "L05", 0x279D, 75, 115),
			new Song("Main Theme (Pikmin)", "L06", 0x279E, 90, 107),
			new Song("Stage Clear / Title (Pikmin)", "L07", 0x279F, 85, 109),
			new Song("Ai no Uta (French Version)", "L08", 0x27A0, 75, 114),
			new Song("WarioWare, Inc.", "M01", 0x27A1, 80, 98),
			new Song("WarioWare, Inc. Medley", "M02", 0x27A2, 85, 99),
			new Song("Mona Pizza's Song (Japanese Version)", "M03", 0x27A3, 80, 106),
			new Song("Mona Pizza's Song (English Version)", "M04", 0x27A4, 80, 105),
			new Song("Mike's Song (Japanese Version)", "M05", 0x27A5, 80, 104),
			new Song("Mike's Song (English Version)", "M06", 0x27A6, 80, 103),
			new Song("Ashley's Song (Japanese Version)", "M07", 0x27A7, 80, 102),
			new Song("Ashley's Song (English Version)", "M08", 0x27A8, 80, 101),
			new Song("Title (Animal Crossing)", "N01", 0x27B3, 83, 117),
			new Song("Go K.K. Rider!", "N02", 0x27B4, 80, 118),
			new Song("2:00 a.m.", "N03", 0x27B5, 80, 119),
			new Song("The Roost", "N05", 0x27B7, 85, 121),
			new Song("Town Hall and Tom Nook's Store", "N06", 0x27B8, 85, 120),
			new Song("K.K. Crusin'", "N07", 0x27B9, null, 177),
			new Song("K.K. Western", "N08", 0x27BA, null, 179),
			new Song("K.K. Gumbo", "N09", 0x27BB, null, 180),
			new Song("Rockin' K.K.", "N10", 0x27BC, null, 181),
			new Song("DJ K.K.", "N11", 0x27BD, null, 182),
			new Song("K.K. Condor", "N12", 0x27BE, null, 183),
			new Song("Underworld", "P01", 0x27BF, 80, 94),
			new Song("Title (Kid Icarus)", "P02", 0x27C0, 80, 96),
			new Song("Skyworld", "P03", 0x27C1, 80, 95),
			new Song("Kid Icarus Original Medley", "P04", 0x27C2, 80, 97),
			new Song("Famicom Medley", "Q01", 0x27C3, 70, 129),
			new Song("Gyromite", "Q02", 0x27C4, 80, 128),
			new Song("Chill (Dr. Mario)", "Q04", 0x27C6, 85, 133),
			new Song("Clu Clu Land", "Q05", 0x27C7, 80, 126),
			new Song("Balloon Trip", "Q06", 0x27C8, 80, 124),
			new Song("Ice Climber", "Q07", 0x27C9, 80, 122),
			new Song("Shin Onigashima", "Q08", 0x27CA, 80, 125),
			new Song("Title (3D Hot Rally)", "Q09", 0x27CB, 80, 146),
			new Song("Tetris: Type A", "Q10", 0x27CC, 80, 143),
			new Song("Tetris: Type B", "Q11", 0x27CD, 80, 144),
			new Song("Tunnel Scene (X)", "Q12", 0x27CE, 80, 147),
			new Song("Power-Up Music", "Q13", 0x27CF, 70, 130),
			new Song("Douchuumen (Nazo no Murasamejo)", "Q14", 0x27D0, 80, 131),
			new Song("PictoChat", "R02", 0x27D2, 85, 135),
			new Song("Hanenbow [NAMELESS]", "R03", 0x27D3, null, null),
			new Song("Flat Zone 2", "R04", 0x27D4, 80, 132),
			new Song("Mario Tennis / Mario Golf", "R05", 0x27D5, 80, 148),
			new Song("Lip's Theme (Panel de Pon)", "R06", 0x27D6, 75, 142),
			new Song("Marionation Gear", "R07", 0x27D7, 80, 149),
			new Song("Title (Big Brain Academy)", "R08", 0x27D8, 80, 150),
			new Song("Golden Forest (1080Snowboarding)", "R09", 0x27D9, 80, 151),
			new Song("Mii Channel", "R10", 0x27DA, 80, 136),
			new Song("Wii Shop Channel", "R11", 0x27DB, 80, 137),
			new Song("Battle Scene / Final Boss (Golden Sun)", "R12", 0x27DC, 85, 152),
			new Song("Shaberu! DS Cooking Navi", "R13", 0x27DD, 80, 138),
			new Song("Excite Truck", "R14", 0x27DE, 80, 153),
			new Song("Brain Age: Train Your Brain in Minutes a Day", "R15", 0x27DF, 80, 139),
			new Song("Opening Theme (Wii Sports)", "R16", 0x27E0, 80, 140),
			new Song("Charge! (Wii Play)", "R17", 0x27E1, 80, 141),
			new Song("Encounter", "S02", 0x27E3, null, 155),
			new Song("Theme of Tara", "S03", 0x27E4, null, 157),
			new Song("Yell \"Dead Cell\"", "S04", 0x27E5, null, 159),
			new Song("Snake Eater (Instrumental)", "S05", 0x27E6, null, 161),
			new Song("MGS4 Theme of Love Smash Bros. Brawl Version", "S06", 0x27E7, null, 154),
			new Song("Cavern", "S07", 0x27E8, null, 160),
			new Song("Battle in the Base", "S08", 0x27E9, null, 158),
			new Song("Theme of Solid Snake", "S10", 0x27EB, null, 162),
			new Song("Calling to the Night", "S11", 0x27EC, null, 163),
			new Song("Credits (Super Smash Bros.)", "T01", 0x27ED, 72, 191),
			new Song("Menu (Super Smash Bros. Melee)", "T02", 0x27EE, 80, 190),
			new Song("Opening (Super Smash Bros. Melee)", "T03", 0x27EF, 80, 192),
			new Song("{FD: Classic Mode Master Hand} [NAMELESS]", "T05", 0x27F1, null, null),
			new Song("Green Hill Zone", "U01", 0x27F2, 80, 164),
			new Song("Scrap Brain Zone", "U02", 0x27F3, 80, 166),
			new Song("Emerald Hill Zone", "U03", 0x27F4, 80, 168),
			new Song("Angel Island Zone", "U04", 0x27F5, 80, 165),
			new Song("Sonic Boom", "U06", 0x27F7, 80, 169),
			new Song("Super Sonic Racing", "U07", 0x27F8, 80, 170),
			new Song("Open Your Heart", "U08", 0x27F9, 80, 171),
			new Song("Live & Learn", "U09", 0x27FA, 80, 172),
			new Song("Sonic Heroes", "U10", 0x27FB, 80, 173),
			new Song("Right There, Ride On", "U11", 0x27FC, 80, 174),
			new Song("HIS WORLD (Instrumental)", "U12", 0x27FD, 80, 175),
			new Song("Seven Rings In Hand", "U13", 0x27FE, 80, 176),
			new Song("Princess Peach's Castle (Melee)", "W01", 0x27FF, 63, 193),
			new Song("Rainbow Cruise (Melee)", "W02", 0x2800, 63, 194),
			new Song("Jungle Japes (Melee)", "W03", 0x2801, 70, 196),
			new Song("Brinstar Depths (Melee)", "W04", 0x2802, 63, 200),
			new Song("Yoshi's Island (Melee)", "W05", 0x2803, 35, 201),
			new Song("Fountain of Dreams (Melee)", "W06", 0x2804, 54, 202),
			new Song("Green Greens (Melee)", "W07", 0x2805, 68, 203),
			new Song("Corneria (Melee)", "W08", 0x2806, 48, 204),
			new Song("Pokémon Stadium (Melee)", "W09", 0x2807, 63, 206),
			new Song("Poké Floats (Melee)", "W10", 0x2808, 40, 207),
			new Song("Big Blue (Melee)", "W11", 0x2809, 55, 209),
			new Song("Mother (Melee)", "W12", 0x280A, 52, 211),
			new Song("Icicle Mountain (Melee)", "W13", 0x280B, 63, 212),
			new Song("Flat Zone (Melee)", "W14", 0x280C, 54, 213),
			new Song("Super Mario Bros. 3 (Melee)", "W15", 0x280D, 63, 214),
			new Song("Battle Theme (Melee)", "W16", 0x280E, 54, 215),
			new Song("Fire Emblem (Melee)", "W17", 0x280F, 80, 216),
			new Song("Mach Rider (Melee)", "W18", 0x2810, 45, 217),
			new Song("Mother 2 (Melee)", "W19", 0x2811, 40, 218),
			new Song("Dr. Mario (Melee)", "W20", 0x2812, 63, 219),
			new Song("Battlefield (Melee)", "W21", 0x2813, 50, 220),
			new Song("Multi-Man Melee 1 (Melee)", "W23", 0x2815, 54, 223),
			new Song("Temple (Melee)", "W24", 0x2816, 45, 197),
			new Song("Final Destination (Melee)", "W25", 0x2817, 52, 224),
			new Song("Kong Jungle (Melee)", "W26", 0x2818, 60, 195),
			new Song("Brinstar (Melee)", "W27", 0x2819, 45, 198),
			new Song("Venom (Melee)", "W28", 0x281A, 48, 205),
			new Song("Mute City (Melee)", "W29", 0x281B, 40, 208),
			new Song("Menu (Melee)", "W30", 0x281C, 58, 222),
			new Song("Giga Bowser (Melee)", "W31", 0x281D, 60, 225),
			new Song("Adventure Map", "Y01", 0x281F, null, 123),
			new Song("Step: The Plain", "Y02", 0x2820, null, 134),
			new Song("Step: The Cave", "Y03", 0x2821, null, 145),
			new Song("Step: Subspace", "Y04", 0x2822, null, 156),
			new Song("Boss Battle Song 1", "Y05", 0x2823, null, 185),
			new Song("{SSE Results} [NAMELESS]", "???", 0x2824, null, null),
			new Song("Boss Battle Song 2", "Y07", 0x2825, null, 186),
			new Song("Save Point", "Y08", 0x2826, null, 187),
			new Song("{SSE DK Jungle} [NAMELESS]", "Y09", 0x2827, null, null),
			new Song("{SSE Luigi Mansion} [NAMELESS]", "Y10", 0x2828, null, null),
			new Song("{Halberd Interior} [NAMELESS]", "Y11", 0x2829, null, null),
			new Song("{SSE Data Select} [NAMELESS]", "Y12", 0x282A, null, null),
			new Song("{SSE Brinstar} [NAMELESS]", "Y13", 0x282B, null, null),
			new Song("Step: Subspace Ver.2", "Y14", 0x282C, null, 167),
			new Song("Step: Subspace Ver.3", "Y15", 0x282D, null, 178),
			new Song("{Halberd Moving} [NAMELESS]", "Y16", 0x282E, null, null),
			new Song("???", "Y17", 0x282F, null, null),
			new Song("???", "Z50", 0x2863, null, null),
			new Song("???", "Z51", 0x2864, null, null),
			new Song("???", "Z54", 0x2867, null, null),
			new Song("???", "Z55", 0x2868, null, null),
			new Song("???", "Z56", 0x2869, null, null),
			new Song("???", "Z57", 0x286A, null, null),
			new Song("???", "Z58", 0x286B, null, null),
		};
	}
}
