--[[
	Library
]]


local CoreLibrary = {}

function CoreLibrary.addPlayer(state, data: TypeDefinitions.PlayerData)
	local weapons = {}
	for weaponId, weaponData in pairs(Conf.weapon_system.weapons) do
		weapons[weaponId] = shallowCopy(weaponData.default_state)
	end
	
	state[data.player] = {
		equipped = nil,
		weapons = weapons,
	}
end

function CoreLibrary.removePlayer(state, data: TypeDefinitions.PlayerData)
	state[data.player] = nil
end

return CoreLibrary
