            [component]
     (class component))
 
+
+(defn add-component
+    "Add a component instance to a given entity. Will overwrite a component if already set."
+    [system entity instance]
+    (let [type (get-component-type instance)
+          system (transient system)
+          entity-components (:entity-components system)]
+        (-> system
+            (assoc! :entity-components (assoc! entity-components type (-> entity-components (get type) (assoc! entity instance))))
+            (assoc! :entity-component-types (-> system :entity-component-types (get entity) (conj! type) (assoc! entity))))
+        persistent!))
+
+#_
 (defn add-component!
     "Add a component instance to a given entity. Will overwrite a component if already set."
     [entity instance]

            (alter entity-components assoc type (dissoc (get @entity-components type) entity))
            (alter entity-component-types assoc entity (disj (get @entity-component-types entity) type)))))

(defn kill-entity!
    "Destroy an entity completely."
    [entity]


(defn create-entity
    "Create the entity and return it. Entities are just UUIDs"
    []
    (java.util.UUID/randomUUID))

(defn get-all-entities
