private void SetControlFlag(ControlFlags flag, bool value) { if (value) agentControls |= (uint)flag; else agentControls &= ~((uint)flag); }