State = class("State")

function State:new()
	local o = instance(self)
	return o
end

function State:update(time)
end

function State:render()

end

function State:onError(err)
	if self.callback and self.callback.onError then
		self.callback:onError(err)
	else
		--print(getClassNameOf(self), "ERR "..err)
	end
end

function State:onMessage(msg)
	if self.callback and self.callback.onMessage then
		self.callback:onMessage(msg)
	else
		--print(getClassNameOf(self), "MSG "..msg)
	end
end

function State:onData(data)
	if self.callback and self.callback.onData then
		self.callback:onData(data)
	else
		--print(getClassNameOf(self), "DATA "..tostring(data))
	end
end