local P=require("\109\111\115\101\115")local E=require("\105\110\118\111\107\097\116\105\111\110\046\099\111\110\115\116\046\105\110\118\111\107\101\114")local C=require("\105\110\118\111\107\097\116\105\111\110\046\099\111\110\115\116\046\110\101\116\095\116\097\098\108\101")function GameMode.setupNetTables(P)P:setupNetTableMain()P:setupNetTableHeroKV()P:setupNetTableAbilitiesKV()end function GameMode.setupNetTableMain(P)P:setupNetTableHeroData()end function GameMode.setupNetTableHeroData(P)P.netTables.MAIN:Set(C.MAIN.KEYS.HERO_DATA,E:Serialize())P:d("  \115\101\116\117\112 \110\101\116 \116\097\098\108\101\115\058 \104\101\114\111 \100\097\116\097")end function GameMode.setupNetTableHeroKV(P)P.netTables.HERO:Set(C.HERO.KEYS.KEY_VALUES,E.HERO_KEY_VALUES:Serialize())P:d("  \115\101\116\117\112 \110\101\116 \116\097\098\108\101\115\058 \104\101\114\111 \107\101\121\118\097\108\117\101\115")end function GameMode.setupNetTableAbilitiesKV(u)u.netTables.ABILITIES:Set(C.ABILITIES.KEYS.KEY_VALUES,P.map(E.ABILITIES_KEY_VALUES,function(P)return P:Serialize()end))u:d("  \115\101\116\117\112 \110\101\116 \116\097\098\108\101\115\058 \097\098\105\108\105\116\105\101\115 \107\101\121\118\097\108\117\101\115")end
--- NetTables
-- @submodule invokation.GameMode

local m = require("moses")

local INVOKER = require("invokation.const.invoker")
local NET_TABLE = require("invokation.const.net_table")

--- NetTables
-- @section net_tables

function GameMode:setupNetTables()
  self:setupNetTableMain()
  self:setupNetTableHeroKV()
  self:setupNetTableAbilitiesKV()
end

function GameMode:setupNetTableMain()
  self:setupNetTableHeroData()
end

function GameMode:setupNetTableHeroData()
  self.netTables.MAIN:Set(NET_TABLE.MAIN.KEYS.HERO_DATA, INVOKER:Serialize())

  self:d("  setup net tables: hero data")
end

function GameMode:setupNetTableHeroKV()
  self.netTables.HERO:Set(NET_TABLE.HERO.KEYS.KEY_VALUES, INVOKER.HERO_KEY_VALUES:Serialize())

  self:d("  setup net tables: hero keyvalues")
end

function GameMode:setupNetTableAbilitiesKV()
  self.netTables.ABILITIES:Set(
    NET_TABLE.ABILITIES.KEYS.KEY_VALUES,
    m.map(INVOKER.ABILITIES_KEY_VALUES, function(kv)
      return kv:Serialize()
    end)
  )

  self:d("  setup net tables: abilities keyvalues")
end
