internal void SetState(int flag, bool value) { this.state = (byte)(value ? (this.state | flag) : (this.state & ~flag)); }