Use extension methods to check BlackboardNotes (or events)
This is a simple example, but it demonstrates how extension methods can make your classes smaller and easier to read.
public override void ReceiveChange(BlackboardNote blackboardNote)
{
if (blackboardNote.IsNewActorSelected())
UpdatePortrait();
}public static bool IsNewActorSelected(this BlackboardNote note)
{
return note.topic == gameData.activePlayerTopic &&
note.subject == gameData.activePlayerSubject;
}Last updated