예제 #1
0
        protected virtual void FuncStart(Game Game, CancellationToken token, IValuta Price)
        {
            TimeStat daystmp = new TimeStat(Game.User.Times);

            daystmp.AddDate(Time);

            TimeStat daybuf = new TimeStat(Game.User.Times);

            daybuf.AddDays(1);
            while (true)
            {
                if (token.IsCancellationRequested)
                {
                    cts.Dispose();
                    return;
                }
                if (Game.User.Times == daybuf)
                {
                    foreach (var x in Abilities)
                    {
                        x.DoEffect();
                    }

                    daybuf = daybuf = new TimeStat(Game.User.Times);
                    daybuf.AddDays(1);
                }
                if (Game.User.Times == daystmp)
                {
                    if (CheckList != null && CheckList.Count > 0)
                    {
                        foreach (var x in CheckList)
                        {
                            if (x.Check() == false)
                            {
                                cts.Cancel();
                                cts.Dispose();
                                IsPressed = !IsPressed;
                                return;
                            }
                        }
                    }

                    NegativeAbility a = new NegativeAbility(Game.User.Valutes, Price);
                    a.DoEffect();

                    daystmp = new TimeStat(Game.User.Times);
                    daystmp.AddDate(Time);
                }
            }
        }
예제 #2
0
        void CheckLoseEvent(TimeStat Time)
        {
            TimeStat loseday = new TimeStat(Time);

            loseday.AddDate(Settings_.daysDied);
            System.Windows.MessageBox.Show(Settings_.warningMessege);
            while (true)
            {
                if (Count > 0)
                {
                    handler = null;
                    flag    = false;
                    return;
                }
                else if (loseday.Is(Time))
                {
                    System.Windows.MessageBox.Show(DiedMessege);
                    flag = true;
                    return;
                }
            }
        }