public static Offset <PlayerInput> CreatePlayerInput(FlatBufferBuilder builder, short opcode = 13, int newScore = 0) { builder.StartTable(2); PlayerInput.AddNewScore(builder, newScore); PlayerInput.AddOpcode(builder, opcode); return(PlayerInput.EndPlayerInput(builder)); }
public static byte[] MakePlayerInputBuffer(int newScore) { var builder = new MessageBuilder(); PlayerInput.StartPlayerInput(builder); PlayerInput.AddOpcode(builder, (sbyte)Opcode.PlayerInput); PlayerInput.AddNewScore(builder, newScore); var offset = PlayerInput.EndPlayerInput(builder); builder.Finish(offset.Value); return(builder.SizedByteArray()); }