ComponentFlags Flags { get; set; }

robot_2Generated
code_blocksInput

Description

The Flags property of a Component in the Sandbox framework is used to store and manage various flags associated with the component. These flags can be used to control or modify the behavior of the component in different ways. The property is of type Sandbox.ComponentFlags, which is an enumeration that defines the possible flags that can be set on a component.

Usage

To use the Flags property, you can get or set the flags for a component to modify its behavior. This property is not static, so it must be accessed through an instance of a Component.

Example usage:

  • To check if a specific flag is set, use bitwise operations.
  • To set or clear a flag, modify the Flags property using bitwise operations.

Example

// Example of setting a flag on a component
Component myComponent = new Component();
myComponent.Flags |= ComponentFlags.SomeFlag;

// Example of checking if a flag is set
bool isFlagSet = (myComponent.Flags & ComponentFlags.SomeFlag) != 0;

// Example of clearing a flag
myComponent.Flags &= ~ComponentFlags.SomeFlag;