namespace FF1Lib
{
	public static partial class ItemLocations
	{
		public static readonly IReadOnlyCollection<IRewardSource> Unused =
		   new List<IRewardSource>{ Unused2, Unused3, Unused4, Unused5,
				Unused6, Unused7, Unused8, Unused9, Unused10, Unused11,
				Unused12, Unused13, Unused14, Unused15 };
		public static readonly IReadOnlyCollection<IRewardSource> Coneria =
			new List<IRewardSource> { Coneria1, Coneria2, ConeriaMajor, Coneria4, Coneria5, Coneria6 };
		public static readonly IReadOnlyCollection<IRewardSource> TempleOfFiends =
			new List<IRewardSource>{ ToFTopLeft1, ToFTopLeft2, ToFBottomLeft,
			ToFBottomRight, ToFTopRight1, ToFTopRight2};
		public static readonly IReadOnlyCollection<IRewardSource> MatoyasCave =
			new List<IRewardSource> { MatoyasCave1, MatoyasCave2, MatoyasCave3 };
		public static readonly IReadOnlyCollection<IRewardSource> Elfland =
			new List<IRewardSource> { Elfland1, Elfland2, Elfland3, Elfland4 };
		public static readonly IReadOnlyCollection<IRewardSource> MarshCave =
			new List<IRewardSource>{ MarshCave1, MarshCave2, MarshCave3, MarshCave4,
			MarshCave5, MarshCave6, MarshCave7, MarshCave8, MarshCaveMajor,
			MarshCave10, MarshCave11, MarshCave12, MarshCave13 };
		public static readonly IReadOnlyCollection<IRewardSource> MarshCaveUnlocked =
			new List<IRewardSource>{ MarshCave1, MarshCave2, MarshCave3, MarshCave4,
			MarshCave5, MarshCave6, MarshCave7, MarshCave8, MarshCaveMajor,
			MarshCave10};
		public static readonly IReadOnlyCollection<IRewardSource> MarshCaveLocked =
			new List<IRewardSource>{ MarshCave11, MarshCave12, MarshCave13 };
		public static readonly IReadOnlyCollection<IRewardSource> NorthwestCastle =
			new List<IRewardSource> { NorthwestCastle1, NorthwestCastle2, NorthwestCastle3 };
		public static readonly IReadOnlyCollection<IRewardSource> DwarfCave =
			new List<IRewardSource>{ DwarfCave1, DwarfCave2, DwarfCave3, DwarfCave4,
			DwarfCave5, DwarfCave6, DwarfCave7, DwarfCave8, DwarfCave9,
			DwarfCave10 };
		public static readonly IReadOnlyCollection<IRewardSource> EarthCave =
			new List<IRewardSource> { EarthCave1, EarthCave2, EarthCave3, EarthCave4,
			EarthCave5, EarthCave6, EarthCave7, EarthCave8, EarthCave9,
			EarthCave10, EarthCave11, EarthCave12, EarthCave13, EarthCave14,
			EarthCave15, EarthCaveMajor, EarthCave17, EarthCave18, EarthCave19,
			EarthCave20, EarthCave21, EarthCave22, EarthCave23, EarthCave24 };
		public static readonly IReadOnlyCollection<IRewardSource> EarthCavePreRod =
			new List<IRewardSource> {
			EarthCave1, EarthCave2, EarthCave3, EarthCave4,
			EarthCave5, EarthCave6, EarthCave7, EarthCave8, EarthCave9,
			EarthCave10, EarthCave11, EarthCave12, EarthCave13, EarthCave14,
			EarthCave15, EarthCaveMajor
		};
		public static readonly IReadOnlyCollection<IRewardSource> EarthCaveFloor4 =
			new List<IRewardSource> { EarthCave17, EarthCave18, EarthCave19,
			EarthCave20, EarthCave21, EarthCave22, EarthCave23, EarthCave24};
		public static readonly IReadOnlyCollection<IRewardSource> TitansTunnel =
			new List<IRewardSource> { TitansTunnel1, TitansTunnel2, TitansTunnel3, TitansTunnel4 };
		public static readonly IReadOnlyCollection<IRewardSource> Volcano =
			new List<IRewardSource> { Volcano1, Volcano2, Volcano3, Volcano4,
			Volcano5, Volcano6, Volcano7, Volcano8, Volcano9,
			Volcano10, Volcano11, Volcano12, Volcano13, Volcano14,
			Volcano15, Volcano16, Volcano17, Volcano18, Volcano19,
			Volcano20, Volcano21, Volcano22, Volcano23, Volcano24,
			Volcano25, Volcano26, Volcano27, Volcano28, Volcano29,
			Volcano30, Volcano31, Volcano32, VolcanoMajor };
		public static readonly IReadOnlyCollection<IRewardSource> VolcanoShallow =
			new List<IRewardSource> { Volcano1, Volcano2, Volcano3, Volcano4,
			Volcano5, Volcano6, Volcano7, Volcano8, Volcano9,
			Volcano10, Volcano11, Volcano12, Volcano13, Volcano14,
			Volcano15, Volcano16, Volcano17, Volcano18 };
		public static readonly IReadOnlyCollection<IRewardSource> VolcanoDeep =
			new List<IRewardSource> { Volcano19,
			Volcano20, Volcano21, Volcano22, Volcano23, Volcano24,
			Volcano25, Volcano26, Volcano27, Volcano28, Volcano29,
			Volcano30, Volcano31, Volcano32, VolcanoMajor };
		public static readonly IReadOnlyCollection<IRewardSource> IceCave =
			new List<IRewardSource> { IceCave1, IceCave2, IceCave3, IceCave4,
			IceCave5, IceCave6, IceCave7, IceCaveMajor, IceCave9,
			IceCave10, IceCave11, IceCave12, IceCave13, IceCave14,
			IceCave15, IceCave16 };
		public static readonly IReadOnlyCollection<IRewardSource> Ordeals =
			new List<IRewardSource> { Ordeals1, Ordeals2, Ordeals3, Ordeals4, Ordeals5,
			Ordeals6, Ordeals7, Ordeals8, OrdealsMajor };
		public static readonly IReadOnlyCollection<IRewardSource> Cardia =
			new List<IRewardSource> { Cardia1, Cardia2, Cardia3, Cardia4, Cardia5,
			Cardia6, Cardia7, Cardia8, Cardia9, Cardia10, Cardia11,
			Cardia12, Cardia13 };
		public static readonly IReadOnlyCollection<IRewardSource> SeaShrine =
			new List<IRewardSource> { SeaShrine1, SeaShrine2, SeaShrine3, SeaShrine4,
			SeaShrine5, SeaShrine6, SeaShrine7, SeaShrine8, SeaShrine9,
			SeaShrine10, SeaShrine11, SeaShrine12, SeaShrine13, SeaShrine14,
			SeaShrine15, SeaShrine16, SeaShrineLocked, SeaShrine18, SeaShrine19,
			SeaShrine20, SeaShrine21, SeaShrine22, SeaShrine23, SeaShrine24,
			SeaShrine25, SeaShrine26, SeaShrine27, SeaShrine28, SeaShrine29,
			SeaShrine30, SeaShrine31, SeaShrineMajor };
		public static readonly IReadOnlyCollection<IRewardSource> SeaShrineUnlocked =
			new List<IRewardSource> { SeaShrine1, SeaShrine2, SeaShrine3, SeaShrine4,
			SeaShrine5, SeaShrine6, SeaShrine7, SeaShrine8, SeaShrine9,
			SeaShrine10, SeaShrine11, SeaShrine12, SeaShrine13, SeaShrine14,
			SeaShrine15, SeaShrine16, SeaShrine18, SeaShrine19,
			SeaShrine20, SeaShrine21, SeaShrine22, SeaShrine23, SeaShrine24,
			SeaShrine25, SeaShrine26, SeaShrine27, SeaShrine28, SeaShrine29,
			SeaShrine30, SeaShrine31, SeaShrineMajor };
		public static readonly IReadOnlyCollection<IRewardSource> SeaShrineMermaids =
			new List<IRewardSource> { SeaShrine20, SeaShrine21, SeaShrine22, SeaShrine23,
			SeaShrine24, SeaShrine25, SeaShrine26, SeaShrine27, SeaShrine28, SeaShrine29,
			SeaShrine30, SeaShrine31, SeaShrineMajor };
		public static readonly IReadOnlyCollection<IRewardSource> SeaShrineUnlockedMinusMermaids =
			new List<IRewardSource> { SeaShrine1, SeaShrine2, SeaShrine3, SeaShrine4,
			SeaShrine5, SeaShrine6, SeaShrine7, SeaShrine8, SeaShrine9,
			SeaShrine10, SeaShrine11, SeaShrine12, SeaShrine13, SeaShrine14,
			SeaShrine15, SeaShrine16, SeaShrine18, SeaShrine19, };
		public static readonly IReadOnlyCollection<IRewardSource> Waterfall =
			new List<IRewardSource> { Waterfall1, Waterfall2, Waterfall3, Waterfall4,
			Waterfall5, Waterfall6 };
		public static readonly IReadOnlyCollection<IRewardSource> MirageTower =
			new List<IRewardSource> { MirageTower1, MirageTower2, MirageTower3, MirageTower4,
			MirageTower5, MirageTower6, MirageTower7, MirageTower8, MirageTower9,
			MirageTower10, MirageTower11, MirageTower12, MirageTower13, MirageTower14,
			MirageTower15, MirageTower16, MirageTower17, MirageTower18 };
		public static readonly IReadOnlyCollection<IRewardSource> SkyPalace =
			new List<IRewardSource> { SkyPalace1, SkyPalace2, SkyPalace3, SkyPalace4,
			SkyPalace5, SkyPalace6, SkyPalace7, SkyPalace8, SkyPalace9,
			SkyPalace10, SkyPalace11, SkyPalace12, SkyPalace13, SkyPalace14,
			SkyPalace15, SkyPalace16, SkyPalace17, SkyPalace18, SkyPalace19,
			SkyPalaceMajor, SkyPalace21, SkyPalace22, SkyPalace23, SkyPalace24,
			SkyPalace25, SkyPalace26, SkyPalace27, SkyPalace28, SkyPalace29,
			SkyPalace30, SkyPalace31, SkyPalace32, SkyPalace33, SkyPalace34 };
		public static readonly IReadOnlyCollection<IRewardSource> ToFR =
			new List<IRewardSource> { ToFRMasmune, ToFRevisited2, ToFRevisited3,
			ToFRevisited4, ToFRevisited5, ToFRevisited6, ToFRevisited7};
		public static readonly IReadOnlyCollection<IRewardSource> AllTreasures =
		Unused.Concat(Coneria).Concat(TempleOfFiends).Concat(MatoyasCave)
			  .Concat(Elfland).Concat(MarshCave).Concat(NorthwestCastle)
			  .Concat(DwarfCave).Concat(EarthCave).Concat(TitansTunnel)
			  .Concat(Volcano).Concat(IceCave).Concat(Ordeals)
			  .Concat(Cardia).Concat(SeaShrine).Concat(Waterfall)
			  .Concat(MirageTower).Concat(SkyPalace).Concat(ToFR)
			  .ToList();

		public static readonly IReadOnlyCollection<IRewardSource> AllNPCFreeItemLocationsExcludingVendor =
			new List<IRewardSource> {
			KingConeria, Princess, Bikke, Sarda, CanoeSage, CubeBot
		};

		public static readonly IReadOnlyCollection<IRewardSource> AllNPCFetchItemLocations =
			new List<IRewardSource> {
			Matoya, ElfPrince, Astos, Nerrick, Smith, Fairy, Lefein
		};

		public static readonly IReadOnlyCollection<IRewardSource> ValidBridgeLocations =
			new List<IRewardSource> {
			KingConeria, Princess,
			ToFTopLeft1, ToFTopLeft2, ToFBottomLeft
		};

		public static readonly IReadOnlyCollection<IRewardSource> ValidShipLocations =
			new List<IRewardSource> {
			KingConeria, Princess, Bikke, Matoya,
			ToFTopLeft1, ToFTopLeft2, ToFBottomLeft
		}.Concat(MatoyasCave).ToList();

		public static readonly IReadOnlyCollection<IRewardSource> AllNPCItemLocations =
			new List<IRewardSource> {
			KingConeria, Princess, Matoya, Bikke, ElfPrince, Astos,
			Nerrick, Smith, Sarda, CanoeSage, CubeBot, Fairy, Lefein
		};

		public static readonly IReadOnlyCollection<IRewardSource> AllShopItemLocations =
			new List<IRewardSource> {
			CaravanItemShop1
		};

		public static readonly IReadOnlyCollection<IRewardSource> AllOtherItemLocations =
			new List<IRewardSource> {
			LichReward, KaryReward, KrakenReward, TiamatReward, ChaosReward
		};

		public static readonly IReadOnlyCollection<IRewardSource> AllNonTreasureItemLocations =
			AllNPCItemLocations.Concat(AllShopItemLocations).Concat(AllOtherItemLocations).ToList();

		public static readonly IReadOnlyCollection<IRewardSource> AllQuestItemLocations =
			AllTreasures.Concat(AllNonTreasureItemLocations).Where(x => !x.IsUnused).ToList();

		public static readonly IReadOnlyCollection<IRewardSource> ChestsKeyItemsLocations =
			new List<IRewardSource> {
			MarshCaveMajor, ConeriaMajor, EarthCaveMajor, IceCaveMajor, OrdealsMajor, SeaShrineMajor, SkyPalaceMajor
		};

		public static readonly IReadOnlyCollection<IRewardSource> AllTreasuresExceptKeyItemsLocations =
			AllTreasures.Except(ChestsKeyItemsLocations).ToList();

		public static readonly IReadOnlyCollection<IRewardSource> CardiaBonusItemLocations =
			new List<IRewardSource> { Unused2, Unused3 };
	}
}
