Exemple #1
0
 public override void On() // включили холодильник
 {
     if (Status == false)
     {
         Status = true;
         if (TurnedOn != null)
         {
             TurnedOn.Invoke("Холодильник включили");
         }
     }
 }
Exemple #2
0
    public IEnumerator TempButton()
    {
        m_Activated          = true;
        m_AlreadyInteracting = true;
        TurnedOn.Invoke();
        yield return(new WaitForSeconds(m_TempButtonDuration));

        m_Activated          = false;
        m_AlreadyInteracting = false;
        TurnedOff.Invoke();
    }
        public void Should_Set_Percentage_To_100_When_Turning_On_Device_Without_Setting_Percentage()
        {
            TurnOnCommand cmd = new TurnOnCommand(Guid.NewGuid());

            var p      = Domain.Device.TurnOn(eventMetadata, moqEventStore.Object, cmd);
            var events = p.GetUncommittedEvents();

            Assert.IsNotEmpty(events);
            Assert.AreEqual(1, events.Count());
            Assert.IsInstanceOf <TurnedOn>(events.First());
            TurnedOn turnedOn = events.First() as TurnedOn;

            turnedOn.Level.ShouldEqual(100);
        }
Exemple #4
0
    private IEnumerator OnWhileOn()
    {
        m_Activated          = true;
        m_AlreadyInteracting = true;
        TurnedOn.Invoke();
        yield return(null);

        yield return(null);

        Debug.Log("Off");
        m_Activated          = false;
        m_AlreadyInteracting = false;
        TurnedOff.Invoke();
        m_OnWhileTriggered = null;
    }
Exemple #5
0
    public IEnumerator ActivationCooldown()
    {
        m_Activated          = !m_Activated;
        m_AlreadyInteracting = true;
        if (m_Activated)
        {
            TurnedOn.Invoke();
        }
        else
        {
            TurnedOff.Invoke();
        }
        yield return(new WaitForSeconds(m_DelayBetweenActivations));

        m_AlreadyInteracting = false;
    }
Exemple #6
0
 public virtual void TurnOn()
 {
     TurnedOn?.Invoke(this, EventArgs.Empty);
     IsOn = true;
 }
Exemple #7
0
 protected virtual void OnButtonOn() => TurnedOn?.Invoke(this, EventArgs.Empty);
Exemple #8
0
 private void Apply(TurnedOn e)
 {
     AggregateGuid = e.AggregateGuid;
     Level         = e.Level;
 }