Esempio n. 1
0
 public void HandleInputChange(RoomInput.ChangedEvent e)
 {
     foreach (var c in Controllers)
     {
         c.HandleInputChange(e);
     }
 }
        public override void HandleInputChange(RoomInput.ChangedEvent e)
        {
            base.HandleInputChange(e);

            var old = value;

            value += e.Input.On ? 1 : -1;
            value  = Math.Max(0, value);

            if (old > 0 && value == 0)
            {
                foreach (var p in Room.Pistons)
                {
                    p.Set(false);
                }
            }
            else if (old == 0 && value > 0)
            {
                foreach (var p in Room.Pistons)
                {
                    p.Set(true);
                }
            }
        }
Esempio n. 3
0
 public override void HandleInputChange(RoomInput.ChangedEvent e)
 {
     base.HandleInputChange(e);
     CheckState();
 }
Esempio n. 4
0
 public virtual void HandleInputChange(RoomInput.ChangedEvent e)
 {
 }
 public override void HandleInputChange(RoomInput.ChangedEvent e)
 {
     base.HandleInputChange(e);
     on = !on;
 }