private static byte[] SerializerQuestInputStartGame(GameInput inputMessage) { InputStartGame msg = (InputStartGame)inputMessage; StartGame proto = new StartGame(); proto.Title = msg.Title; var data = proto.ToByteArray(); return(data); }
private static GameInput DeserializeStartGame(byte[] data) { StartGame startGame = StartGame.Parser.ParseFrom(data); if (startGame != null) { InputStartGame inputStartGame = new InputStartGame(); inputStartGame.Title = startGame.Title; inputStartGame.Difficulty = startGame.Difficulty; return(inputStartGame); } return(null); }