예제 #1
0
        /// <summary>
        /// timer sleep ticked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void timerSleep_Tick(object sender, EventArgs e)
        {
            this.progressBarMain.PerformStep();

            //if timer complete all seconds
            if (this.progressBarMain.Value == this.progressBarMain.Maximum)
            {
                this.timerSleep.Stop();
                this.progressBarMain.Value = 0;

                //produce a sleep object and consume it
                Sleep sleep = new BasicNeedFactory().Produce(BasicNeed.sleep) as Sleep;
                sleep.Consume();

                WriteLog("After this nap the Tamagotchi should feel more relaxed", Color.DarkGreen);

                SetProgressBarValues();
                EnableButtons();
            }
        }
예제 #2
0
        /// <summary>
        /// timer poop ticked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void timerPoop_Tick(object sender, EventArgs e)
        {
            this.progressBarMain.PerformStep();

            //if timer complete all seconds
            if (this.progressBarMain.Value == this.progressBarMain.Maximum)
            {
                this.timerPoop.Stop();
                this.progressBarMain.Value = 0;

                //produce a poop object and consume it ... wait whaaaaaaaattt !!! ughhh
                Poop poop = new BasicNeedFactory().Produce(BasicNeed.poop) as Poop;
                poop.Consume();

                WriteLog("After pooping the Tamagotchi should feel fresh new again", Color.DarkGreen);

                SetProgressBarValues();
                EnableButtons();
            }
        }
예제 #3
0
        /// <summary>
        /// timer play ticked event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void timerPlay_Tick(object sender, EventArgs e)
        {
            this.progressBarMain.PerformStep();

            //if timer complete all seconds
            if (this.progressBarMain.Value == this.progressBarMain.Maximum)
            {
                this.timerPlay.Stop();
                this.progressBarMain.Value = 0;

                //produce a fun object and consume it
                Fun fun = new BasicNeedFactory().Produce(BasicNeed.fun) as Fun;
                fun.Consume();

                WriteLog("Playing with Tamagotchi completed he should be in better shape now", Color.DarkGreen);

                SetProgressBarValues();
                EnableButtons();
            }
        }