Refactor arena modes and add objective event feed
This commit is contained in:
1 parent
df6ab8efe1
commit
b87a3770a1
26 files changed
+1221
-654
No files matched your search
@@ -0,0 +1,17 @@
|
||||
--!strict
|
||||
local Types = require(script.Parent.Types)
|
||||
local Scoring = {}
|
||||
function Scoring.new(state: Instance, onAdd: ((Types.Side, number, string?, Player?) -> ())?): Types.Scoring
|
||||
local score: {[Types.Side]: number} = {Blue = 0, Orange = 0}
|
||||
state:SetAttribute("BlueScore", 0)
|
||||
state:SetAttribute("OrangeScore", 0)
|
||||
return {
|
||||
add = function(side, points, reason, credit)
|
||||
score[side] += points
|
||||
state:SetAttribute(side .. "Score", score[side])
|
||||
if onAdd then onAdd(side, points, reason, credit) end
|
||||
end,
|
||||
get = function(side) return score[side] end,
|
||||
}
|
||||
end
|
||||
return Scoring
|
||||
Reference in new issue
Block a user