---
description: >-
  This is a simple example, but it demonstrates how extension methods can make
  your classes smaller and easier to read.
---

# Use extension methods to check BlackboardNotes (or events)

As seen in the RPG demo project (`CreationPortraitImages.c`s & `CreationExtensions.cs`), when a `BlackboardNote` is passed to a `ReceiveChange()` method, we can sipmly call something very easy to read:

```csharp
public override void ReceiveChange(BlackboardNote blackboardNote)
{
     if (blackboardNote.IsNewActorSelected())
          UpdatePortrait();
}
```

In this code, `IsNewActorSelected()` is an extension method for `BlackboardNote` objects. Check `CreationExtensions.cs` to see the code:

<pre class="language-csharp"><code class="lang-csharp">public static bool IsNewActorSelected(this BlackboardNote note)
{
<strong>    return note.topic == gameData.activePlayerTopic &#x26;&#x26;
</strong>        note.subject == gameData.activePlayerSubject;
}
</code></pre>

In the demo project, we know that the `BlackboardNote` which contains the active player information will only be updated (and sent as a notitication) when it changes. So this extension method returns true if the _**to**_**pic** and _**subject**_ of the `BlackboardNote` match the topic and subject we have hard coded in the `gameData` class.
