MessagesSetGameScore.deserialize constructor

MessagesSetGameScore.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory MessagesSetGameScore.deserialize(BinaryReader reader) {
  // Read [MessagesSetGameScore] fields.
  final flags = reader.readInt32();
  final editMessage = (flags & 1) != 0;
  final force = (flags & 2) != 0;
  final peer = reader.readObject() as InputPeerBase;
  final id = reader.readInt32();
  final userId = reader.readObject() as InputUserBase;
  final score = reader.readInt32();

  // Construct [MessagesSetGameScore] object.
  final returnValue = MessagesSetGameScore(
    editMessage: editMessage,
    force: force,
    peer: peer,
    id: id,
    userId: userId,
    score: score,
  );

  // Now return the deserialized [MessagesSetGameScore].
  return returnValue;
}