local class = require'common.class' local Pos = require'common.coords'.Pos local nextid = 1 local function random_color() return {math.random(),math.random(),math.random()} end local Player = class() function Player.make(cls,peer) local self = { pos = Pos:make(0,0), color = random_color(), peer = peer, id = nextid, } nextid = nextid + 1 return setmetatable(self,cls) end function Player.info_part(self) -- eh return { id=self.id, x=self.pos.x, y=self.pos.y, color=self.color, } end return {Player=Player}