> For the complete documentation index, see [llms.txt](https://maraudical.gitbook.io/status-effects-framework/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://maraudical.gitbook.io/status-effects-framework/1.2.0/type-specifics/interfaces/istatus.md).

# IStatus

IStatus needs a **public list of effects** to be defined as well as the method **OnStatusEffect**. Here is a simple example class using that implementation:

```csharp
// Need to use StatusEffects namespace.
using StatusEffects;
using UnityEngine;
// Inheriting from MonoBehaviour and IStatus.
public class Example : MonoBehaviour, IStatus
{
    public List<StatusEffect> effects { get; set; }
    
    public void OnStatusEffect(StatusEffect statusEffect, bool started) { }
}
```

## Extensions

After inheriting, the class will now be able to call **extension methods** specific to the Status Effect Framework. For more information on what exactly is available see [StatusManager](/status-effects-framework/1.2.0/type-specifics/classes/statusmanager.md).

```csharp
// Examples using the add and remove status effect extension.
public StatusEffectData slownessEffect;
public float effectTime = 5;

public void OnDamageTaken()
{
    // Note that if no effect time 
    // is given it will be infinite.
    this.AddStatusEffect(slownessEffect, effectTime);
}

public void OnLevelCompleted()
{
    // Use this to remove all status effects.
    this.RemoveAllStatusEffects();
    // Use this to remove a specific status effect.
    this.RemoveStatusEffect(slownessEffect);
}
```

## Effects

The effects list will **dynamically update** as effects are added or removed. It is recommended to **not directly add or remove** using the list methods and instead only interact with it from a read only permission and the extension methods.

## OnStatusEffect

The method **OnStatusEffect** will be called everytime there is a change to the effect list of the IStatus class. Its parameters return the updated effect and a bool of whether the effect was started or stopped. If a project requires an on screen effect UI this method would be ideal to use   in tandem with public actions subscription on each [StatusEffect's](/status-effects-framework/1.2.0/type-specifics/classes/statuseffect.md) started and stopped event.
