void Firmata_DigitalStateChangeReceived(object parSender, DigitalPinState parEventArgs)
        {
            if (_port >= 0 && _port != parEventArgs.Port)
                return;

            Observers.ForEach(o => o.OnNext(parEventArgs));
        }
Exemplo n.º 2
0
        public void Clear(Player winner, Player loser)
        {
            Free    = true;
            Started = false;

            BroadcastMessage(new SDuelBroadcastRound()
            {
                Flag = 1
            });
            BroadcastMessage(new SDuelBroadcastResult(winner.Character.Name, loser.Character.Name));
            Challenger.Session.SendAsync(new SDuelAnsExit(DuelResults.NoError, (ushort)Challenged.Session.ID, Challenged.Character.Name)).Wait();
            Challenged.Session.SendAsync(new SDuelAnsExit(DuelResults.NoError, (ushort)Challenger.Session.ID, Challenger.Character.Name)).Wait();

            Observers.ForEach(x => x.Character.Spells.ClearBuffByEffect(SkillStates.DuelInterface).Wait());
            Observers.Clear();
            ChallengerPoints                     = 0;
            ChallengedPoints                     = 0;
            Challenger.Character.Duel            = null;
            Challenged.Character.Duel            = null;
            Challenger.Character.CharacterRegen -= Character_CharacterRegen;
            Challenged.Character.CharacterRegen -= Character_CharacterRegen;
            Challenger.Character.PlayerDie      -= ChallengerDie;
            Challenged.Character.PlayerDie      -= ChallengedDie;
            Challenger.Character.WarpTo(17).Wait();
            Challenged.Character.WarpTo(17).Wait();
            Challenger = null;
            Challenged = null;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Notify all observers to call 'update()' method. Retuns tha basic state of bool's.
 /// </summary>
 private void notifyAll()
 {
     Observers.ForEach(element => {
         element.update();
     });
     _isDelivery = false;
     _isSold     = false;
 }
Exemplo n.º 4
0
        void Firmata_AnalogStateChangeReceived(object parSender, FirmataEventArgs <AnalogState> parEventArgs)
        {
            if (_channel >= 0 && _channel != parEventArgs.Value.Channel)
            {
                return;
            }

            Observers.ForEach(o => o.OnNext(parEventArgs.Value));
        }
Exemplo n.º 5
0
        void Firmata_DigitalStateReceived(object parSender, FirmataEventArgs <DigitalPortState> parEventArgs)
        {
            if (_port >= 0 && _port != parEventArgs.Value.Port)
            {
                return;
            }

            Observers.ForEach(o => o.OnNext(parEventArgs.Value));
        }
Exemplo n.º 6
0
 void NotifyObservers(HtmlDoc htmlDoc)
 {
     Observers.ForEach(x => x.OnNext(htmlDoc));
 }
Exemplo n.º 7
0
 internal void NotifyNewGeneration()
 {
     Observers.ForEach(observer => observer.OnNext(World));
 }
Exemplo n.º 8
0
 void Firmata_StepperPositionReceived(object parSender, FirmataEventArgs <StepperPosition> parEventArgs)
 {
     Observers.ForEach(o => o.OnNext(parEventArgs.Value));
 }
Exemplo n.º 9
0
 private void I2CReplyReceived(object parSender, I2CEventArgs parEventArgs)
 {
     Observers.ForEach(o => o.OnNext(parEventArgs.Value));
 }
Exemplo n.º 10
0
Arquivo: Bank.cs Projeto: mkryuk/DP
 public void Notify()
 {
     Console.WriteLine($"Rate changed!!! New rate is {Rate}");
     Observers.ForEach(item => item.Update(this));
 }
Exemplo n.º 11
0
 void TrackingSource_StringReceived(object parSender, StringEventArgs parEventArgs)
 {
     Observers.ForEach(o => o.OnNext(parEventArgs.Text));
 }
Exemplo n.º 12
0
 public void Notify()
 {
     Observers.ForEach(o => o.Update());
 }
 void Firmata_MultiStepperMoveCompelteReceived(object parSender, FirmataEventArgs <int> parEventArgs)
 {
     Observers.ForEach(o => o.OnNext(parEventArgs.Value));
 }
Exemplo n.º 14
0
 private void NotifyObservers()
 {
     Observers.ForEach(x => x.OnNext(Encoding.UTF8.GetString(ReadBuffer.Take(BytesRead).ToArray())));
 }
Exemplo n.º 15
0
 public void Dispose()
 {
     Stop();
     Observers.ForEach(x => x.OnCompleted());
     HttpStream = null;
 }
Exemplo n.º 16
0
 void Firmata_SerialReplyReceived(object parSender, SerialEventArgs parEventArgs)
 {
     Observers.ForEach(o => o.OnNext(parEventArgs.Value));
 }