Initial Reupload

This commit is contained in:
Lucas Magnien
2019-05-28 09:16:53 +02:00
parent c7dea7beef
commit ded79721a1
368 changed files with 12298 additions and 2 deletions

View File

@@ -0,0 +1,43 @@
module( "player_class", package.seeall )
local ClassTables = {}
function Register( name, classtable )
ClassTables[ name ] = classtable
ClassTables[ name ].m_HasBeenSetup = false
end
function Get( name )
if ( !ClassTables[ name ] ) then return {} end
// Derive class here.
// I have favoured using table.Inherit over using a meta table
// This is to the performance hit is once, now, rather than on every usage
if ( !ClassTables[ name ].m_HasBeenSetup ) then
ClassTables[ name ].m_HasBeenSetup = true
local Base = ClassTables[ name ].Base
if ( ClassTables[ name ].Base && Get( Base ) ) then
ClassTables[ name ] = table.Inherit( ClassTables[ name ], Get( Base ) )
ClassTables[ name ].BaseClass = Get( Base )
end
end
return ClassTables[ name ]
end
function GetClassName( name )
local class = Get( name )
if (!class) then return name end
return class.DisplayName
end