Skip to content

Commit

Permalink
more playfield stuff (TODO: Modchart stuff?)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuglioIsStupid committed Nov 28, 2024
1 parent 864f511 commit 7ca0004
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Game/Objects/Game/Mania/Playfield.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,31 @@ local Playfield = Group:extend("Playfield")
function Playfield:new(underlay, receptors)
Group.new(self)

self.notes = {}

self:add(underlay)
self:add(receptors)
end

function Playfield:add(obj)
if obj:isInstanceOf(HitObject) then
table.insert(self.notes, obj)
end

Group.add(self, obj)
end

function Playfield:remove(obj)
if obj:isInstanceOf(HitObject) then
for i, note in ipairs(self.notes) do
if note == obj then
table.remove(self.notes, i)
break
end
end
end

Group.remove(self, obj)
end

return Playfield

0 comments on commit 7ca0004

Please sign in to comment.