> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kodeflowstudios.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FlagHandler

> Namespace: KodeFlowStudios.Parley.FlagHandling

A presence-only flag set attached to a conversation, used for narrative branching.

**Declaration**

```C# theme={null}
	public class FlagHandler
```

#### Description

A simple set of string flags attached to a conversation. Think of it as a lightweight state bag — no values, just presence/absence. If you need to track quantities or structured data, lift it into your own game state and leave flags for narrative branching.

## Methods

### SetFlag(string)

Marks a single flag as set. Silently no-ops on null/empty input (and logs an error).

**Declaration**

```c# theme={null}
public void SetFlag(string flag)
```

**Parameters**

<ParamField path="flag" type="string" required>
  Flag to be set.
</ParamField>

### SetFlags(List\<string>)

Sets multiple flags in one go. Convenient when a node ends a whole questline.

**Declaration**

```c# theme={null}
public void SetFlags(List<string> _flags)
```

**Parameters**

<ParamField path="_flags" type="List<string>" required>
  List of flags to be set.
</ParamField>

### IsFlagSet(string)

True if `flag` has been set on this conversation.

**Declaration**

```c# theme={null}
public bool IsFlagSet(string flag)
```

**Parameters**

<ParamField path="flag" type="string" required>
  Flag to be checked.
</ParamField>

**Returns**

<ResponseField name="result" type="bool">
  Value of the flag returned from the evaluation.
</ResponseField>

### ClearFlag(string)

Unsets a single flag. No-ops if it wasn't set to begin with.

**Declaration**

```c# theme={null}
public void ClearFlag(string flag)
```

**Parameters**

<ParamField path="flag" type="string" required>
  Flag to be cleared.
</ParamField>

### ClearFlags(List\<string>)

Unsets a batch of flags. Useful when a major story beat resets a chapter's state.

**Declaration**

```c# theme={null}
public void ClearFlags(List<string> _flags)
```

**Parameters**

<ParamField path="_flags" type="List<string>" required>
  List of flags to be cleared.
</ParamField>

### GetAllSetFlags()

Returns a snapshot copy of every currently-set flag. Safe to iterate or persist.

**Declaration**

```c# theme={null}
public List<string> GetAllSetFlags()
```

**Returns**

<ResponseField name="result" type="List<string>">
  List of all the set flags.
</ResponseField>

### ToggleFlag(string)

Inverts a flag's presence — adds it if absent, removes it if present.

**Declaration**

```c# theme={null}
public void ToggleFlag(string flag)
```

**Parameters**

<ParamField path="flag" type="string" required>
  Flag to be toggled.
</ParamField>

### ClearAllFlags()

Clears all the stored flags.

**Declaration**

```c# theme={null}
public void ClearAllFlags()
```
