Esempio n. 1
0
        /// <summary>
        /// Initializes this AreaAura with the given controller.
        /// If no controller is given, the AreaAura controls timing and disposal itself.
        /// </summary>
        /// <param name="controller">A controller controls timing and disposal of this AreaAura</param>
        /// <param name="noTimeout">whether the Aura should not expire (ignore the Spell's duration).</param>
        public void Start(ITickTimer controller, bool noTimeout)
        {
            if (this.m_IsActivated)
            {
                return;
            }
            if ((double)this.m_radius == 0.0)
            {
                this.m_radius = 5f;
            }
            this.m_controller = controller;
            if (this.m_controller == null || this.m_controller.MaxTicks == 1)
            {
                this.m_timer = this.m_params == null
                    ? new TimerEntry(AreaAura.DefaultAmplitude, AreaAura.DefaultAmplitude,
                                     new Action <int>(this.RevalidateTargetsAndApply))
                    : new TimerEntry(this.m_params.StartDelay,
                                     this.m_params.Amplitude != 0 ? this.m_params.Amplitude : AreaAura.DefaultAmplitude,
                                     new Action <int>(this.RevalidateTargetsAndApply));
            }
            if (noTimeout)
            {
                this.m_duration = int.MaxValue;
            }
            else
            {
                this.m_duration = this.m_spell.GetDuration(this.m_CasterReference);
                if (this.m_duration < 1)
                {
                    this.m_duration = int.MaxValue;
                }
            }

            this.IsActivated = true;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes this AreaAura with the given controller.
        /// If no controller is given, the AreaAura controls timing and disposal itself.
        /// </summary>
        /// <param name="controller">A controller controls timing and disposal of this AreaAura</param>
        /// <param name="noTimeout">whether the Aura should not expire (ignore the Spell's duration).</param>
        public void Start(ITickTimer controller, bool noTimeout)
        {
            if (m_IsActivated)
            {
                return;
            }
            if (m_radius == 0.0)
            {
                m_radius = 5f;
            }
            m_controller = controller;
            if (m_controller == null || m_controller.MaxTicks == 1)
            {
                m_timer = m_params == null
          ? new TimerEntry(DefaultAmplitude, DefaultAmplitude,
                           RevalidateTargetsAndApply)
          : new TimerEntry(m_params.StartDelay,
                           m_params.Amplitude != 0 ? m_params.Amplitude : DefaultAmplitude,
                           RevalidateTargetsAndApply);
            }
            if (noTimeout)
            {
                m_duration = int.MaxValue;
            }
            else
            {
                m_duration = m_spell.GetDuration(m_CasterReference);
                if (m_duration < 1)
                {
                    m_duration = int.MaxValue;
                }
            }

            IsActivated = true;
        }
Esempio n. 3
0
        /// <summary>Method is called</summary>
        /// <param name="noTimeout">Whether the Aura should always continue and never expire.</param>
        public void Start(ITickTimer controller, bool noTimeout)
        {
            m_controller = controller;
            m_duration   = !noTimeout?Spell.GetDuration(m_CasterReference, m_auras.Owner) : -1;

            SetupTimer();
            Start();
        }
Esempio n. 4
0
        /// <summary>Method is called</summary>
        /// <param name="noTimeout">Whether the Aura should always continue and never expire.</param>
        public void Start(ITickTimer controller, bool noTimeout)
        {
            this.m_controller = controller;
            this.m_duration   = !noTimeout?this.Spell.GetDuration(this.m_CasterReference, this.m_auras.Owner) : -1;

            this.SetupTimer();
            this.Start();
        }
Esempio n. 5
0
        /// <summary>
        /// Method is called
        /// </summary>
        /// <param name="noTimeout">Whether the Aura should always continue and never expire.</param>
        public void Start(ITickTimer controller, bool noTimeout)
        {
            m_controller = controller;

            if (noTimeout)
            {
                m_duration = -1;
            }
            else
            {
                m_duration = Spell.GetDuration(m_CasterReference, m_auras.Owner);
            }

            SetupTimer();
            Start();
        }
Esempio n. 6
0
        public MainWindowViewModel(IApplicationMessageEvent applicationMessageEvent, IPomodoro pomodoro)
        {
            // setup for ApplicationMessageEvent to communicate with other viewmodels and views
            Messenger = applicationMessageEvent;
            Subject  += ((IApplicationMessage m) => m.Execute(this));

            this.pomodoro                 = pomodoro;
            pomodoro.OnSwitchToBreak     += new Action(OnSwitchToBreakEvent);
            pomodoro.OnSwitchToTask      += new Action(OnSwitchToTaskEvent);
            pomodoro.OnSwitchToLongBreak += new Action(OnSwitchToLongBreakEvent);
            pomodoro.OnCompletePomodoro  += new Action(OnCompletePomodoroEvent);

            tickTimer           = new TickTimer(50);
            tickTimer.OnTick   += new Action(OnTick);
            MainButtonCommand   = new StartCommand(this);
            ConfigButtonCommand = new ConfigButtonCommandImpl(applicationMessageEvent);

            InitializeBackgroundColor();
        }
Esempio n. 7
0
		/// <summary>
		/// Initializes this AreaAura with the given controller. 
		/// If no controller is given, the AreaAura controls timing and disposal itself.
		/// </summary>
		/// <param name="controller">A controller controls timing and disposal of this AreaAura</param>
		/// <param name="noTimeout">whether the Aura should not expire (ignore the Spell's duration).</param>
		public void Start(ITickTimer controller, bool noTimeout)
		{
			if (m_IsActivated)
			{
				return;
			}

			if (m_radius == 0)
			{
				m_radius = 5;
			}

			m_controller = controller;

			if (m_controller == null || m_controller.MaxTicks == 1)
			{
				if (m_params != null)
				{
					m_timer = new TimerEntry(m_params.StartDelay,
											 m_params.Amplitude != 0 ? m_params.Amplitude : DefaultAmplitude, RevalidateTargetsAndApply);
				}
				else
				{
					m_timer = new TimerEntry(DefaultAmplitude, DefaultAmplitude, RevalidateTargetsAndApply);
				}
			}

			if (noTimeout)
			{
				m_duration = int.MaxValue;
			}
			else
			{
				m_duration = m_spell.GetDuration(m_CasterReference);
				if (m_duration < 1)
				{
					m_duration = int.MaxValue;
				}
			}
			IsActivated = true;
		}
Esempio n. 8
0
 internal TimerTrigger(ITickTimer timer)
 {
     this.timer = timer;
 }
Esempio n. 9
0
		/// <summary>
		/// Initializes this AreaAura with the given controller. 
		/// If no controller is given, the AreaAura controls timing and disposal itself.
		/// </summary>
		/// <param name="controller">A controller controls timing and disposal of this AreaAura</param>
		/// <param name="noTimeout">whether the Aura should not expire (ignore the Spell's duration).</param>
		public void Start(ITickTimer controller, bool noTimeout)
		{
			if (m_radius == 0)
			{
				m_radius = 5;
			}
			if (m_timer == null)
			{
				m_controller = controller;

				if (m_controller == null)
				{
					if (m_params != null)
					{
						m_timer = new TimerEntry(m_params.StartDelay,
							m_params.Amplitude != 0 ? m_params.Amplitude : DefaultAmplitude, RevalidateTargetsAndApply);
					}
					else
					{
						m_timer = new TimerEntry(DefaultAmplitude, DefaultAmplitude, RevalidateTargetsAndApply);
					}
					m_timer.Start();
				}

				if (noTimeout)
				{
					m_duration = int.MaxValue;
				}
				else
				{
					m_duration = m_spell.GetDuration(m_casterInfo) / 1000f;
					if (m_duration < 1)
					{
						m_duration = int.MaxValue;
					}
				}
			}
		}
Esempio n. 10
0
 internal TimerTrigger(ITickTimer timer)
 {
     this.timer = timer;
 }