diff --git a/lua/cfw/classes/contraption_sv.lua b/lua/cfw/classes/contraption_sv.lua index 3391458..aaf2605 100644 --- a/lua/cfw/classes/contraption_sv.lua +++ b/lua/cfw/classes/contraption_sv.lua @@ -1,7 +1,7 @@ -- Contraptions are an object to refer to a collection of connected entities -CFW.contraptions = {} -CFW.classes.contraption = {} +CFW.Contraptions = {} +CFW.Classes.Contraption = {} function CFW.createContraption() local con = { @@ -10,7 +10,7 @@ function CFW.createContraption() color = ColorRand(50, 255) } - setmetatable(con, CFW.classes.contraption) + setmetatable(con, CFW.Classes.Contraption) con:Init() @@ -26,12 +26,12 @@ do -- Contraption getters and setters end do -- Class def - local CLASS = CFW.classes.contraption + local CLASS = CFW.Classes.Contraption CLASS.__index = CLASS function CLASS:Init() - CFW.contraptions[self] = true + CFW.Contraptions[self] = true hook.Run("cfw.contraption.created", self) end @@ -72,7 +72,7 @@ do -- Class def hook.Run("cfw.contraption.removed", self) end - CFW.contraptions[self] = nil + CFW.Contraptions[self] = nil end function CLASS:Defuse() diff --git a/lua/cfw/classes/family_sv.lua b/lua/cfw/classes/family_sv.lua index c14a040..eb31b25 100644 --- a/lua/cfw/classes/family_sv.lua +++ b/lua/cfw/classes/family_sv.lua @@ -1,9 +1,9 @@ -- Families are collections of parented entities, you know, parents... children... -CFW.classes.family = {} -CFW.families = {} +CFW.Classes.Family = {} +CFW.Families = {} -function CFW.classes.family.create(ancestor) +function CFW.Classes.Family.create(ancestor) local fam = { count = 0, ents = {}, @@ -11,7 +11,7 @@ function CFW.classes.family.create(ancestor) color = ColorRand() } - setmetatable(fam, CFW.classes.family) + setmetatable(fam, CFW.Classes.Family) fam:Init() fam:Add(ancestor) @@ -20,10 +20,10 @@ function CFW.classes.family.create(ancestor) end do -- Class def - local CLASS = CFW.classes.family; CLASS.__index = CLASS + local CLASS = CFW.Classes.Family; CLASS.__index = CLASS function CLASS:Init() - CFW.families[self] = true + CFW.Families[self] = true hook.Run("cfw.family.created", self) end @@ -37,7 +37,7 @@ do -- Class def hook.Run("cfw.family.deleted", self) - CFW.families[self] = nil + CFW.Families[self] = nil end function CLASS:Add(entity) @@ -102,7 +102,7 @@ do end if not newFamily and next(self:GetChildren()) then - CFW.classes.family.create(self) + CFW.Classes.Family.create(self) end end diff --git a/lua/cfw/classes/link_sv.lua b/lua/cfw/classes/link_sv.lua index 6f2142a..06f66bc 100644 --- a/lua/cfw/classes/link_sv.lua +++ b/lua/cfw/classes/link_sv.lua @@ -2,7 +2,7 @@ -- These are used to keep track of the number of connections between two entities -- In graph theory these are edges -CFW.classes.link = {} +CFW.Classes.Link = {} function CFW.createLink(a, b) local indexA, indexB = a:EntIndex(), b:EntIndex() @@ -22,13 +22,13 @@ function CFW.createLink(a, b) a._links[indexB] = link b._links[indexA] = link - setmetatable(link, CFW.classes.link) + setmetatable(link, CFW.Classes.Link) return link:Init() end do -- Class def - local CLASS = CFW.classes.link + local CLASS = CFW.Classes.Link CLASS.__index = CLASS -- why? diff --git a/lua/cfw/core/parenting_sv.lua b/lua/cfw/core/parenting_sv.lua index 1d90e84..9453313 100644 --- a/lua/cfw/core/parenting_sv.lua +++ b/lua/cfw/core/parenting_sv.lua @@ -69,7 +69,7 @@ hook.Add("Initialize", "CFW", function() if newParent._family then self:SetFamily(newParent._family) else - CFW.classes.family.create(newParent) + CFW.Classes.Family.create(newParent) end else self:SetFamily(nil) diff --git a/lua/cfw/extensions/position_sv.lua b/lua/cfw/extensions/position_sv.lua index dc69da0..b97f93c 100644 --- a/lua/cfw/extensions/position_sv.lua +++ b/lua/cfw/extensions/position_sv.lua @@ -1,4 +1,4 @@ -local CLASS = CFW.classes.contraption +local CLASS = CFW.Classes.Contraption local VEC_0 = Vector(0, 0, 0) local HUGE = math.huge diff --git a/lua/entities/gmod_wire_expression2/core/custom/cfw.lua b/lua/entities/gmod_wire_expression2/core/custom/cfw.lua index 795b084..9baf44f 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/cfw.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/cfw.lua @@ -1,7 +1,7 @@ E2Lib.RegisterExtension("contraption", true, "Enables interaction with Contraption Framework") local function isValidContraption(c) - return CFW.contraptions[c] or false + return CFW.Contraptions[c] or false end do -- Datatype and operator