summaryrefslogtreecommitdiffhomepage
path: root/signatures.rb
blob: c11c048f7e5c2cfda91b9977e464e19775a53b66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class ID
  class <<self
    @next_id = 0b0_010_000_000_000

    def create_new_id(name)
      temp = @next_id
      @next_id *= 2
      define_singleton_method(name) do
        temp
      end
      send(name)
    end

    def renderable
      0b0_001
    end

    def sprite
      0b0_010
    end

    def label
      0b0_100
    end

    def player_control
      0b0_001_000
    end

    def map
      0b0_010_000
    end

    def interactable
      0b0_100_000
    end

    def collidable
      0b0_001_000_000
    end

    def overworld
      0b0_010_000_000
    end

    def indoor
      0b0_100_000_000
    end

    def battle
      0b0_001_000_000_000
    end
  end
end