Ejemplo n.º 1
0
        public void AddFighters(bool firstRound)
        {
            if (firstRound)
            {
                m_Participants = Contestants.Count;
                Contestants    = new List <Mobile>(RandomizeGenericList(Contestants)); //Randomize
            }

            if (Contestants.Count > 1)
            {
                if (!firstRound && Fighting.Count <= 0)
                {
                    for (int i = 0; i < Winners.Count; ++i)
                    {
                        Winners[i].MoveToWorld(JoinLocation, JoinMap);
                    }

                    TournamentCore.SendMessage(Contestants, "Next round will start in 60 seconds!");
                    Contestants = new List <Mobile>(RandomizeGenericList(Contestants)); //Randomize
                    Winners.Clear();
                    Timer.DelayCall(TimeSpan.FromSeconds(60), new TimerCallback(SpawnContestants));
                }
                else
                {
                    SpawnContestants();
                }
            }
            else
            {
                EndTournament(true);
            }
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="el"></param>
 public void SetWinner(XElement el)
 {
     Winners.Clear();
     foreach (var elc in el.Descendants("Candidat"))
     {
         Winners.Add(new CandidatViewModel(elc));
     }
     RaisePropertyChanged("Tooltip");
 }
Ejemplo n.º 3
0
        private void GenerateStageDecoration()
        {
            if (Winners != null)
            {
                Winners.Clear();
            }

            if (PointTable != null)
            {
                PointTable.Clear();
            }

            if (RewardBag != null)
            {
                RewardBag.Delete();
                RewardBag = null;
            }

            var map      = Siege.SiegeShard ? Map.Felucca : Map.Trammel;
            int treeType = 1;

            switch (CurrentCity)
            {
            case City.Trinsic: treeType = 2; break;

            case City.Britain:
            case City.NewMagincia: treeType = 3; break;

            case City.Minoc: treeType = 4; break;
            }

            if (TownTree != null)
            {
                TownTree.Delete();
            }

            TownTree = new TownTree(treeType);
            TownTree.MoveToWorld(_CityLocations[Stage], map);

            if (Elf == null)
            {
                Elf = new FestivalElf();
            }

            var p = new Point3D(TownTree.X + Utility.RandomMinMax(-1, 1), TownTree.Y + Utility.RandomMinMax(-1, 1), TownTree.Z);

            Elf.MoveToWorld(p, map);
            Elf.Home      = p;
            Elf.RangeHome = 5;
        }
Ejemplo n.º 4
0
        public SpinResult Spin()
        {
            Winners.Clear();
            var rouletteNumber = RandomizeResult();
            var spinResult     = new SpinResult(rouletteNumber);

            spinResult.RouletteNumber = rouletteNumber;
            LastSpinResult            = spinResult;

            ProcessResult(spinResult);

            SpinHistory.Add(spinResult);

            return(spinResult);
        }
Ejemplo n.º 5
0
        protected override void Remove()
        {
            Utility.WriteConsoleColor(ConsoleColor.Green, string.Format("{0} Disabled!", Name));

            EndTimer();
            Stage     = -1;
            NextStage = DateTime.MinValue;

            if (Elf != null)
            {
                Elf.Delete();
                Elf = null;
            }

            if (Winners != null)
            {
                Winners.Clear();
                Winners = null;
            }

            if (TownTree != null)
            {
                TownTree.Delete();
                TownTree = null;
            }

            if (RewardBag != null)
            {
                RewardBag.Delete();
                RewardBag = null;
            }

            ColUtility.Free(_CityOrder);
            _CityOrder = null;

            Running = false;
        }
Ejemplo n.º 6
0
 public void Reset()
 {
     Bets.Clear();
     Winners.Clear();
     SpinHistory.Clear();
 }