예제 #1
0
            public void MIDIEnter(Signal n)
            {
                lock (locker) {
                    int layer = -n.Layer;

                    if (n.Color.Lit)
                    {
                        _signals[layer] = n.Clone();
                    }
                    else if (_signals.ContainsKey(layer))
                    {
                        _signals.Remove(layer);
                    }
                    else
                    {
                        return;
                    }

                    Color newState = GetColor();

                    if (newState != state)
                    {
                        Signal m = n.Clone();
                        m.Color = state = newState;
                        Exit?.Invoke(m);
                    }
                }
            }
예제 #2
0
            public void MIDIEnter(Signal n)
            {
                lock (locker) {
                    if (n.Index != Index)
                    {
                        return;
                    }

                    int layer = -n.Layer;

                    if (n.Color.Lit)
                    {
                        _signals[layer] = n.Clone();
                    }
                    else if (_signals.ContainsKey(layer))
                    {
                        _signals.Remove(layer);
                    }
                    else
                    {
                        return;
                    }

                    Update();
                }
            }