(ns sekai.entity.tags
  (:require [sekai.core.gamestate :refer [game-state]]
            [sekai.entity.entity :as entity]))

(defn register-tag! [eid tag]
  (swap! game-state update-in [:tags tag] (fnil conj #{}) eid)
  (entity/update-component! eid :tags #((fnil conj #{}) % tag))
  )

(defn deregister-tag! [eid tag]
  (swap! game-state update-in [:tags tag] disj eid)
  (entity/update-component! eid :tags #(disj % tag)))
