protected override void OnCreate(Bundle savedInstanceState) { string granadaName = Resources.GetString(Resource.String.granada); base.OnCreate(savedInstanceState); Dictionary <string, List <ExpansionModule> > extensions = new Dictionary <string, List <ExpansionModule> >() { [Resources.GetString(Resource.String.expansion_modules)] = new List <ExpansionModule>() { ExpansionModule.ExpansionViziersFavour, ExpansionModule.ExpansionCurrencyExchangeCards, ExpansionModule.ExpansionBonusCards, ExpansionModule.ExpansionSquares, ExpansionModule.ExpansionCityGates, ExpansionModule.ExpansionDiamonds, ExpansionModule.ExpansionCharacters, ExpansionModule.ExpansionCamps, ExpansionModule.ExpansionCityWalls, ExpansionModule.ExpansionThieves, ExpansionModule.ExpansionChange, ExpansionModule.ExpansionStreetTrader, ExpansionModule.ExpansionTreasureChamber, ExpansionModule.ExpansionMasterBuilders, ExpansionModule.ExpansionInvaders, ExpansionModule.ExpansionBazaars, ExpansionModule.ExpansionNewScoreCards, ExpansionModule.ExpansionPowerOfSultan, ExpansionModule.ExpansionCaravanserai, ExpansionModule.ExpansionArtOfTheMoors, ExpansionModule.ExpansionFalconers, ExpansionModule.ExpansionWatchtowers, ExpansionModule.ExpansionBuildingSites, ExpansionModule.ExpansionExchangeCertificates, }, [Resources.GetString(Resource.String.queenie_expansion_modules)] = new List <ExpansionModule>() { ExpansionModule.QueenieMagicalBuildings, ExpansionModule.QueenieMedina, }, [Resources.GetString(Resource.String.designer_expansion_modules)] = new List <ExpansionModule>() { ExpansionModule.DesignerNewBuildingGrounds, ExpansionModule.DesignerMajorConstructionProjects, ExpansionModule.DesignerPalaceStaff, ExpansionModule.DesignerOrchards, ExpansionModule.DesignerTravellingCraftsmen, ExpansionModule.DesignerBathhouses, ExpansionModule.DesignerWishingWell, ExpansionModule.DesignerFreshColors, ExpansionModule.DesignerPalaceDesigners, ExpansionModule.DesignerAlhambraZoo, ExpansionModule.DesignerGatesWithoutEnd, ExpansionModule.DesignerBuildingsOfPower, ExpansionModule.DesignerExtensions, ExpansionModule.DesignerHandymen, ExpansionModule.FanPersonalBuildingMarket, ExpansionModule.FanTreasures, ExpansionModule.FanCaliphsGuidelines, }, [Resources.GetString(Resource.String.new_market_modules)] = new List <ExpansionModule>() { ExpansionModule.NewMarket, }, }; Dictionary <string, List <GranadaOption> > granadaOptions = new Dictionary <string, List <GranadaOption> >() { [granadaName] = new List <GranadaOption>() { GranadaOption.Without, GranadaOption.With, GranadaOption.Alone, }, }; expandableListView = FindViewById <ExpandableListViewExtension>(Resource.Id.expandableListView); ExpandListCheckBoxAdapterMultiple <ExpansionModule> adapter = new ExpandListCheckBoxAdapterMultiple <ExpansionModule>(this, extensions); expandableListView.SetAdapter(adapter); expandableListView.HoldSize = true; expandableListView2 = FindViewById <ExpandableListViewExtension>(Resource.Id.expandableListView2); ExpandListCheckBoxAdapterSingle <GranadaOption> adapter2 = new ExpandListCheckBoxAdapterSingle <GranadaOption>(this, granadaOptions); expandableListView2.SetAdapter(adapter2); expandableListView2.HoldSize = true; Button startButton = FindViewById <Button>(Resource.Id.startButton); startButton.Click += new EventHandler((object sender, EventArgs e) => { Application.GameApplyModules(adapter.SelectedList, adapter2.SelectedList[granadaName]); }); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); List <SetupInstructions> setupTiles = new List <SetupInstructions>(); List <SetupInstructions> setupCards = new List <SetupInstructions>(); List <SetupInstructions> setupOther = new List <SetupInstructions>(); AddSetupInstruction(setupTiles, SetupInstructions.PutBuildingsOfPowerTiles, Game.HasModule(ExpansionModule.DesignerBuildingsOfPower)); AddSetupInstruction(setupTiles, SetupInstructions.PutCampTiles, Game.HasModule(ExpansionModule.ExpansionCamps)); AddSetupInstruction(setupTiles, SetupInstructions.PutBazaarsTiles, Game.HasModule(ExpansionModule.ExpansionBazaars)); AddSetupInstruction(setupTiles, SetupInstructions.PutMagicalBuildingsTiles, Game.HasModule(ExpansionModule.QueenieMagicalBuildings)); AddSetupInstruction(setupTiles, SetupInstructions.PutMedinaTiles, Game.HasModule(ExpansionModule.QueenieMedina)); AddSetupInstruction(setupTiles, SetupInstructions.PutNewBuildingGroundsTiles, Game.HasModule(ExpansionModule.DesignerNewBuildingGrounds)); AddSetupInstruction(setupTiles, SetupInstructions.PutBathhouseTiles, Game.HasModule(ExpansionModule.DesignerBathhouses)); AddSetupInstruction(setupTiles, SetupInstructions.PutWishingWellTiles, Game.HasModule(ExpansionModule.DesignerWishingWell)); AddSetupInstruction(setupTiles, SetupInstructions.ShuffleBuildingTiles, Game.GranadaOption != GranadaOption.Alone); AddSetupInstruction(setupTiles, SetupInstructions.GranadaShuffleBuildingTiles, Game.GranadaOption != GranadaOption.Without); AddSetupInstruction(setupTiles, SetupInstructions.DealTrader, Game.HasModule(ExpansionModule.ExpansionStreetTrader)); AddSetupInstruction(setupTiles, SetupInstructions.PlaceBuildings, Game.GranadaOption != GranadaOption.Alone); AddSetupInstruction(setupTiles, SetupInstructions.GiveBuildingsToDirk, Game.InvolvedDirk); AddSetupInstruction(setupTiles, SetupInstructions.GranadaPlaceBuildings, Game.GranadaOption != GranadaOption.Without); AddSetupInstruction(setupCards, SetupInstructions.RemoveCardDeck, Game.InvolvedDirk); AddSetupInstruction(setupCards, SetupInstructions.PutDiamondCards, Game.HasModule(ExpansionModule.ExpansionDiamonds)); AddSetupInstruction(setupCards, SetupInstructions.ShuffleCards); AddSetupInstruction(setupCards, SetupInstructions.DealMoney); AddSetupInstruction(setupCards, SetupInstructions.PlaceCards); AddSetupInstruction(setupCards, SetupInstructions.DivideCards); AddSetupInstruction(setupCards, SetupInstructions.Put2ScoringCards, Game.GranadaOption != GranadaOption.With); AddSetupInstruction(setupCards, SetupInstructions.Put1ScoringCardMiddle, Game.GranadaOption == GranadaOption.With); AddSetupInstruction(setupCards, SetupInstructions.PutCurrencyExchangeCards, Game.HasModule(ExpansionModule.ExpansionCurrencyExchangeCards)); AddSetupInstruction(setupCards, SetupInstructions.PutCityGatesCards, Game.HasModule(ExpansionModule.ExpansionCityGates)); AddSetupInstruction(setupCards, SetupInstructions.PutCharacters, Game.HasModule(ExpansionModule.ExpansionCharacters)); AddSetupInstruction(setupCards, SetupInstructions.PutCityWalls, Game.HasModule(ExpansionModule.ExpansionCityWalls)); AddSetupInstruction(setupCards, SetupInstructions.PutMasterBuilders, Game.HasModule(ExpansionModule.ExpansionMasterBuilders) && Game.PlayersCount != 6); AddSetupInstruction(setupCards, SetupInstructions.PutMasterBuilders6, Game.HasModule(ExpansionModule.ExpansionMasterBuilders) && Game.PlayersCount == 6); AddSetupInstruction(setupCards, SetupInstructions.PutPowerOfSultan, Game.HasModule(ExpansionModule.ExpansionPowerOfSultan)); AddSetupInstruction(setupCards, SetupInstructions.JoinPiles); AddSetupInstruction(setupOther, SetupInstructions.ShuffleSquares, Game.HasModule(ExpansionModule.ExpansionSquares)); AddSetupInstruction(setupOther, SetupInstructions.ShuffleWatchtowers, Game.HasModule(ExpansionModule.ExpansionWatchtowers)); AddSetupInstruction(setupOther, SetupInstructions.ShuffleMajorConstructionProjects, Game.HasModule(ExpansionModule.DesignerMajorConstructionProjects)); AddSetupInstruction(setupOther, SetupInstructions.ShuffleGateBoard, Game.HasModule(ExpansionModule.DesignerGatesWithoutEnd)); AddSetupInstruction(setupOther, SetupInstructions.ShuffleExtensions, Game.HasModule(ExpansionModule.DesignerExtensions)); AddSetupInstruction(setupOther, SetupInstructions.DealVizier, Game.HasModule(ExpansionModule.ExpansionViziersFavour)); AddSetupInstruction(setupOther, SetupInstructions.DealBonusCards3, Game.HasModule(ExpansionModule.ExpansionBonusCards) && Game.PlayersCount == 3); AddSetupInstruction(setupOther, SetupInstructions.DealBonusCards2, Game.HasModule(ExpansionModule.ExpansionBonusCards) && (Game.PlayersCount == 4 || Game.PlayersCount == 5)); AddSetupInstruction(setupOther, SetupInstructions.DealBonusCards1, Game.HasModule(ExpansionModule.ExpansionBonusCards) && Game.PlayersCount == 6); AddSetupInstruction(setupOther, SetupInstructions.PlaceCityGates, Game.HasModule(ExpansionModule.ExpansionCityGates)); AddSetupInstruction(setupOther, SetupInstructions.PlaceCityWalls, Game.HasModule(ExpansionModule.ExpansionCityWalls)); AddSetupInstruction(setupOther, SetupInstructions.DealThieves4, Game.HasModule(ExpansionModule.ExpansionThieves) && Game.PlayersCount == 3); AddSetupInstruction(setupOther, SetupInstructions.DealThieves3, Game.HasModule(ExpansionModule.ExpansionThieves) && Game.PlayersCount == 4); AddSetupInstruction(setupOther, SetupInstructions.DealThieves2, Game.HasModule(ExpansionModule.ExpansionThieves) && (Game.PlayersCount == 5 || Game.PlayersCount == 6)); AddSetupInstruction(setupOther, SetupInstructions.PlaceChange, Game.HasModule(ExpansionModule.ExpansionChange)); AddSetupInstruction(setupOther, SetupInstructions.PlaceTrader, Game.HasModule(ExpansionModule.ExpansionStreetTrader)); AddSetupInstruction(setupOther, SetupInstructions.PlaceTraderTiles, Game.HasModule(ExpansionModule.ExpansionStreetTrader)); AddSetupInstruction(setupOther, SetupInstructions.PlaceTreasureChamber, Game.HasModule(ExpansionModule.ExpansionTreasureChamber)); AddSetupInstruction(setupOther, SetupInstructions.DealMasterBuilders, Game.HasModule(ExpansionModule.ExpansionMasterBuilders)); AddSetupInstruction(setupOther, SetupInstructions.ShuffleInvasion, Game.HasModule(ExpansionModule.ExpansionInvaders)); AddSetupInstruction(setupOther, SetupInstructions.ShuffleScout, Game.HasModule(ExpansionModule.ExpansionInvaders)); AddSetupInstruction(setupOther, SetupInstructions.PlacePowerOfSultan, Game.HasModule(ExpansionModule.ExpansionPowerOfSultan)); AddSetupInstruction(setupOther, SetupInstructions.ShuffleCaravanserai, Game.HasModule(ExpansionModule.ExpansionCaravanserai)); AddSetupInstruction(setupOther, SetupInstructions.PlaceCaravanserai, Game.HasModule(ExpansionModule.ExpansionCaravanserai)); AddSetupInstruction(setupOther, SetupInstructions.PlaceArtOfTheMoors, Game.HasModule(ExpansionModule.ExpansionArtOfTheMoors)); AddSetupInstruction(setupOther, SetupInstructions.PlaceFalcons, Game.HasModule(ExpansionModule.ExpansionFalconers)); AddSetupInstruction(setupOther, SetupInstructions.ShuffleBuildingSites, Game.HasModule(ExpansionModule.ExpansionBuildingSites)); AddSetupInstruction(setupOther, SetupInstructions.DealExchangeCertificate, Game.HasModule(ExpansionModule.ExpansionExchangeCertificates)); AddSetupInstruction(setupOther, SetupInstructions.PlaceExchangeCertificate1, Game.HasModule(ExpansionModule.ExpansionExchangeCertificates) && Game.PlayersCountWithoutDirk == 2); AddSetupInstruction(setupOther, SetupInstructions.PlaceExchangeCertificate2, Game.HasModule(ExpansionModule.ExpansionExchangeCertificates) && (Game.PlayersCountWithoutDirk == 3 || Game.PlayersCount == 4)); AddSetupInstruction(setupOther, SetupInstructions.PlaceExchangeCertificate3, Game.HasModule(ExpansionModule.ExpansionExchangeCertificates) && (Game.PlayersCount == 5 || Game.PlayersCount == 6)); AddSetupInstruction(setupOther, SetupInstructions.PlaceMagicalBuildings, Game.HasModule(ExpansionModule.QueenieMagicalBuildings)); AddSetupInstruction(setupOther, SetupInstructions.PlaceNewBuildingGrounds, Game.HasModule(ExpansionModule.DesignerNewBuildingGrounds)); AddSetupInstruction(setupOther, SetupInstructions.DealMajorConstructionMarker, Game.HasModule(ExpansionModule.DesignerMajorConstructionProjects)); AddSetupInstruction(setupOther, SetupInstructions.ShuffleServantTiles, Game.HasModule(ExpansionModule.DesignerPalaceStaff)); AddSetupInstruction(setupOther, SetupInstructions.ShuffleOrchardsBoards, Game.HasModule(ExpansionModule.DesignerOrchards)); AddSetupInstruction(setupOther, SetupInstructions.ShuffleOrchardsFruits, Game.HasModule(ExpansionModule.DesignerOrchards)); AddSetupInstruction(setupOther, SetupInstructions.RemoveCraftsmen5, Game.HasModule(ExpansionModule.DesignerTravellingCraftsmen) && (Game.PlayersCount == 3 || Game.PlayersCount == 4)); AddSetupInstruction(setupOther, SetupInstructions.RemoveCraftsmen6, Game.HasModule(ExpansionModule.DesignerTravellingCraftsmen) && (Game.PlayersCount == 5 || Game.PlayersCount == 6)); AddSetupInstruction(setupOther, SetupInstructions.DealCraftsmen, Game.HasModule(ExpansionModule.DesignerTravellingCraftsmen)); AddSetupInstruction(setupOther, SetupInstructions.RemoveProjectTiles, Game.HasModule(ExpansionModule.DesignerFreshColors) && Game.PlayersCount == 3); AddSetupInstruction(setupOther, SetupInstructions.ShuffleProjectTiles, Game.HasModule(ExpansionModule.DesignerFreshColors)); AddSetupInstruction(setupOther, SetupInstructions.PlaceColorTiles, Game.HasModule(ExpansionModule.DesignerFreshColors)); AddSetupInstruction(setupOther, SetupInstructions.DealPalaceDesigners, Game.HasModule(ExpansionModule.DesignerPalaceDesigners)); AddSetupInstruction(setupOther, SetupInstructions.PlacePalaceDesigners, Game.HasModule(ExpansionModule.DesignerPalaceDesigners)); AddSetupInstruction(setupOther, SetupInstructions.ShuffleAnimals, Game.HasModule(ExpansionModule.DesignerAlhambraZoo)); AddSetupInstruction(setupOther, SetupInstructions.DealHandymen, Game.HasModule(ExpansionModule.DesignerHandymen)); AddSetupInstruction(setupOther, SetupInstructions.DealPersonalBuildingMarket, Game.HasModule(ExpansionModule.FanPersonalBuildingMarket)); AddSetupInstruction(setupOther, SetupInstructions.DealTreasures, Game.HasModule(ExpansionModule.FanTreasures)); AddSetupInstruction(setupOther, SetupInstructions.PlaceMissions, Game.HasModule(ExpansionModule.FanCaliphsGuidelines)); AddSetupInstruction(setupOther, SetupInstructions.PlaceNewMarket, Game.HasModule(ExpansionModule.NewMarket)); Dictionary <string, List <SetupInstructions> > setup = new Dictionary <string, List <SetupInstructions> >() { [Resources.GetString(Resource.String.tiles)] = setupTiles, [Resources.GetString(Resource.String.cards)] = setupCards, [Resources.GetString(Resource.String.other)] = setupOther, }; expandableListView = FindViewById <ExpandableListViewExtension>(Resource.Id.expandableListView); ExpandListCheckBoxAdapterMultiple <SetupInstructions> adapter = new ExpandListCheckBoxAdapterMultiple <SetupInstructions>(this, setup); expandableListView.SetAdapter(adapter); expandableListView.Expand(); Button playButton = FindViewById <Button>(Resource.Id.startButton); playButton.Click += new EventHandler((object sender, EventArgs e) => { Application.GameStart(); }); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); //TODO na każdej zakładce przycisk next przechodzący do następnej zakładki Dictionary <string, List <NewScoreCard> > newScoreCards = new Dictionary <string, List <NewScoreCard> >() { [Resources.GetString(Resource.String.scoring_score_card_1)] = new List <NewScoreCard>() { NewScoreCard.Card1, NewScoreCard.Card2, NewScoreCard.Card3, NewScoreCard.Card4, NewScoreCard.Card5, NewScoreCard.Card6, NewScoreCard.Card7, NewScoreCard.Card8, NewScoreCard.Card9, NewScoreCard.Card10, NewScoreCard.Card11, NewScoreCard.Card12, NewScoreCard.Card13, NewScoreCard.Card14, NewScoreCard.Card15, NewScoreCard.Card16, NewScoreCard.Card17, NewScoreCard.Card18 }, [Resources.GetString(Resource.String.scoring_score_card_2)] = new List <NewScoreCard>() { NewScoreCard.Card1, NewScoreCard.Card2, NewScoreCard.Card3, NewScoreCard.Card4, NewScoreCard.Card5, NewScoreCard.Card6, NewScoreCard.Card7, NewScoreCard.Card8, NewScoreCard.Card9, NewScoreCard.Card10, NewScoreCard.Card11, NewScoreCard.Card12, NewScoreCard.Card13, NewScoreCard.Card14, NewScoreCard.Card15, NewScoreCard.Card16, NewScoreCard.Card17, NewScoreCard.Card18 }, [Resources.GetString(Resource.String.scoring_score_card_3)] = new List <NewScoreCard>() { NewScoreCard.Card1, NewScoreCard.Card2, NewScoreCard.Card3, NewScoreCard.Card4, NewScoreCard.Card5, NewScoreCard.Card6, NewScoreCard.Card7, NewScoreCard.Card8, NewScoreCard.Card9, NewScoreCard.Card10, NewScoreCard.Card11, NewScoreCard.Card12, NewScoreCard.Card13, NewScoreCard.Card14, NewScoreCard.Card15, NewScoreCard.Card16, NewScoreCard.Card17, NewScoreCard.Card18 }, }; Dictionary <string, List <CaliphsGuidelinesMission> > missions = new Dictionary <string, List <CaliphsGuidelinesMission> >() { [Resources.GetString(Resource.String.caliphs_guidelines_missions)] = new List <CaliphsGuidelinesMission>() { CaliphsGuidelinesMission.Mission1, CaliphsGuidelinesMission.Mission2, CaliphsGuidelinesMission.Mission3, CaliphsGuidelinesMission.Mission4, CaliphsGuidelinesMission.Mission5, CaliphsGuidelinesMission.Mission6, CaliphsGuidelinesMission.Mission7, CaliphsGuidelinesMission.Mission8, CaliphsGuidelinesMission.Mission9, }, }; ExpandListCheckBoxAdapterSingle <NewScoreCard> adapterNewScoreCards = null; ExpandListCheckBoxAdapterMultiple <CaliphsGuidelinesMission> adapterCaliphsGuidelines = null; if (Game.HasModule(ExpansionModule.ExpansionNewScoreCards)) { newScoreCardsExpandableListView = FindViewById <ExpandableListViewExtension>(Resource.Id.listView1); adapterNewScoreCards = new ExpandListCheckBoxAdapterSingle <NewScoreCard>(this, newScoreCards); newScoreCardsExpandableListView.SetAdapter(adapterNewScoreCards); newScoreCardsExpandableListView.HoldSize = true; newScoreCardsExpandableListView.Expand(); } if (Game.HasModule(ExpansionModule.FanCaliphsGuidelines)) { caliphsGuidelinesExpandableListView = FindViewById <ExpandableListViewExtension>(Resource.Id.listView2); adapterCaliphsGuidelines = new ExpandListCheckBoxAdapterMultiple <CaliphsGuidelinesMission>(this, missions); caliphsGuidelinesExpandableListView.SetAdapter(adapterCaliphsGuidelines); caliphsGuidelinesExpandableListView.HoldSize = true; caliphsGuidelinesExpandableListView.Expand(); } Button startButton = FindViewById <Button>(Resource.Id.startButton); startButton.Click += new EventHandler((object sender, EventArgs e) => { Application.GameApplyModulesDetails(adapterCaliphsGuidelines?.SelectedList, adapterNewScoreCards?.SelectedList.Select(d => d.Value).ToList()); }); }