Exemple #1
0
        private void LoadFromXML()
        {
            List<TutorialPair> pairList;
            TriggerType triggerNextItem;
            TutorialItem item;
            int triggerConstraint1;

            pairList = new List<TutorialPair>();
            pairList.Add(new TutorialPair("Ahoj, dej další kolo", new Vector2(0, 100)));
            pairList.Add(new TutorialPair("Tady je to skvely", new Vector2(200, 50)));
            triggerConstraint1 = 0;
            triggerNextItem = TriggerType.NextTurn;
            item = new TutorialItem(pairList, triggerNextItem, triggerConstraint1);
            tutorialList.Enqueue(item);

            /*
            pairList = new List<TutorialPair>();
            pairList.Add(new TutorialPair("Otevři market", new Vector2(300, 50)));
            triggerConstraint1 = 0;
            triggerNextItem = TriggerType.MarketOpen;
            item = new TutorialItem(pairList, triggerNextItem, triggerConstraint1);
            tutorialList.Enqueue(item);

            pairList = new List<TutorialPair>();
            pairList.Add(new TutorialPair("Vyměň kámen", new Vector2(300, 100)));
            triggerConstraint1 = 2;
            triggerNextItem = TriggerType.MarketFirstRow;
            item = new TutorialItem(pairList, triggerNextItem, triggerConstraint1);
            tutorialList.Enqueue(item);

            pairList = new List<TutorialPair>();
            pairList.Add(new TutorialPair("Za rudu", new Vector2(300, 100)));
            triggerConstraint1 = 4;
            triggerNextItem = TriggerType.MarketSecondRow;
            item = new TutorialItem(pairList, triggerNextItem, triggerConstraint1);
            tutorialList.Enqueue(item);

            pairList = new List<TutorialPair>();
            pairList.Add(new TutorialPair("Posuvníkem navol množství a potvrď", new Vector2(300, 100)));
            triggerConstraint1 = 0;
            triggerNextItem = TriggerType.MarketChangeSources;
            item = new TutorialItem(pairList, triggerNextItem, triggerConstraint1);
            tutorialList.Enqueue(item);

            pairList = new List<TutorialPair>();
            pairList.Add(new TutorialPair("A zavři", new Vector2(300, 100)));
            triggerConstraint1 = 0;
            triggerNextItem = TriggerType.MarketClose;
            item = new TutorialItem(pairList, triggerNextItem, triggerConstraint1);
            tutorialList.Enqueue(item);
             */

            pairList = new List<TutorialPair>();
            pairList.Add(new TutorialPair("Vyber žluté město", mapView.GetTownViewByID(10).getWorld()));
            triggerConstraint1 = 10;
            triggerNextItem = TriggerType.TownChoose;
            item = new TutorialItem(pairList, triggerNextItem, triggerConstraint1);
            tutorialList.Enqueue(item);

            pairList = new List<TutorialPair>();
            pairList.Add(new TutorialPair("Postav klášter", mapView.GetHexaViewByID(2).World));
            triggerConstraint1 = 2;
            triggerNextItem = TriggerType.HexaBuild;
            item = new TutorialItem(pairList, triggerNextItem, triggerConstraint1);
            tutorialList.Enqueue(item);

            pairList = new List<TutorialPair>();
            pairList.Add(new TutorialPair("Postav klášter", new Vector2(300, 300)));
            triggerConstraint1 = (int)BuildingKind.MonasteryBuilding;
            triggerNextItem = TriggerType.BuildingBuild;
            item = new TutorialItem(pairList, triggerNextItem, triggerConstraint1);
            tutorialList.Enqueue(item);

            pairList = new List<TutorialPair>();
            pairList.Add(new TutorialPair("Klikni znovu", mapView.GetTownViewByID(10).getWorld()));
            triggerConstraint1 = 10;
            triggerNextItem = TriggerType.TownUnchoose;
            item = new TutorialItem(pairList, triggerNextItem, triggerConstraint1);
            tutorialList.Enqueue(item);

            pairList = new List<TutorialPair>();
            pairList.Add(new TutorialPair("Postav žluté město", mapView.GetTownViewByID(14).getWorld()));
            triggerConstraint1 = 14;
            triggerNextItem = TriggerType.TownBuild;
            item = new TutorialItem(pairList, triggerNextItem, triggerConstraint1);
            tutorialList.Enqueue(item);
        }
Exemple #2
0
 public void ClearAll()
 {
     tutorialList.Clear();
     ClearActiveItem();
     activeItem = null;
 }
Exemple #3
0
        public void TurnOn()
        {
            ClearActiveItem();

            if (tutorialList.Count > 0)
            {
                activeItem = tutorialList.Dequeue();
                TriggerManager.Inst().Attach(this, activeItem.NextItem);
                switch (activeItem.NextItem)
                {
                    case TriggerType.MessageClose :
                        for(int loop1 = 1; loop1 < activeItem.PairList.Count; loop1++)
                            Message.Inst().Show(activeItem.PairList[0].Text, activeItem.PairList[loop1].Text, GameResources.Inst().GetHudTexture(HUDTexture.IconMedalTown));
                        break;

                    case TriggerType.TownBuild :
                        if (mapView.GetTownViewByID(activeItem.TriggerContraint1).getTownModel().GetIsBuild())
                            TurnOn();
                        else
                            TownView.TutorialID = activeItem.TriggerContraint1;
                        break;
                    case TriggerType.TownChoose:
                    case TriggerType.TownUnchoose:
                        TownView.TutorialID = activeItem.TriggerContraint1;
                        break;

                    case TriggerType.RoadBuild :
                        if (mapView.GetRoadViewByID(activeItem.TriggerContraint1).Model.GetIsBuild())
                            TurnOn();
                        else
                            RoadView.TutorialID = activeItem.TriggerContraint1;
                        break;
                    default :
                        break;
                }
            }
            else
            {
                activeItem = null;
            }
        }