summaryrefslogtreecommitdiffhomepage
path: root/app/ECS/base_component.rb
blob: a40ef52ab65af82357cb448a4f2a16881ff6c039 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class ECS
  class BaseComponent
    class <<self
      def data
        @data ||= {}
      end

      def add(entity_id, **args)
        data[entity_id] = new(**args)
      end

      def delete(entity_id)
        data.delete entity_id
      end
    end
  end
end