From 9cdea7cd1be8dd542fa6032780324cebe2708e3e Mon Sep 17 00:00:00 2001 From: Erik Onarheim Date: Sat, 30 Mar 2024 00:10:18 -0500 Subject: [PATCH] fix: Make addTag/removeTag chainable --- src/engine/EntityComponentSystem/Entity.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/engine/EntityComponentSystem/Entity.ts b/src/engine/EntityComponentSystem/Entity.ts index 1acfc1326..5b6f591f8 100644 --- a/src/engine/EntityComponentSystem/Entity.ts +++ b/src/engine/EntityComponentSystem/Entity.ts @@ -181,9 +181,10 @@ export class Entity implements OnIniti * Adds a tag to an entity * @param tag */ - public addTag(tag: string) { + public addTag(tag: string): Entity { this._tags.add(tag); this.tagAdded$.notifyAll(tag); + return this; } /** @@ -192,9 +193,10 @@ export class Entity implements OnIniti * Removals are deferred until the end of update * @param tag */ - public removeTag(tag: string) { + public removeTag(tag: string): Entity { this._tags.delete(tag); this.tagRemoved$.notifyAll(tag); + return this; } /**