Beispiel #1
0
 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));
 }
Beispiel #2
0
        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());
        }