Stubbed out files for networking

This commit is contained in:
2020-03-26 14:25:55 -05:00
parent bb8e210362
commit c18309614f
14 changed files with 194 additions and 4 deletions

18
lib/networking/packet.rb Normal file
View File

@@ -0,0 +1,18 @@
class IMICFPS
module Networking
class Packet
def initialize(type:, payload:)
end
def self.encode(packet)
"#{packet.type}|#{packet.payload}"
end
def self.decode(string)
split = string.split("|")
Packet.new(split.first, split.last)
end
end
end
end