コード例 #1
0
        public void Activate()
        {
            if (this.hasActivated && this.isSingleActivation)
            {
                // Can only activate this switch once
                return;
            }

            this.currentState = this.currentState == BlockSwitchState.Off
                                ? BlockSwitchState.On
                                : BlockSwitchState.Off;

            this.hasActivated     = true;
            this.wasJustActivated = true;
        }
コード例 #2
0
 public void Reset()
 {
     this.currentState = startState;
     this.hasActivated = false;
 }