StarGiftAuctionState.deserialize constructor

StarGiftAuctionState.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory StarGiftAuctionState.deserialize(BinaryReader reader) {
  // Read [StarGiftAuctionState] fields.
  final version = reader.readInt32();
  final startDate = reader.readDateTime();
  final endDate = reader.readDateTime();
  final minBidAmount = reader.readInt64();
  final bidLevels = reader.readVectorObject<AuctionBidLevelBase>();
  final topBidders = reader.readVectorInt64();
  final nextRoundAt = reader.readInt32();
  final lastGiftNum = reader.readInt32();
  final giftsLeft = reader.readInt32();
  final currentRound = reader.readInt32();
  final totalRounds = reader.readInt32();
  final rounds = reader.readVectorObject<StarGiftAuctionRoundBase>();

  // Construct [StarGiftAuctionState] object.
  final returnValue = StarGiftAuctionState(
    version: version,
    startDate: startDate,
    endDate: endDate,
    minBidAmount: minBidAmount,
    bidLevels: bidLevels.items,
    topBidders: topBidders.items,
    nextRoundAt: nextRoundAt,
    lastGiftNum: lastGiftNum,
    giftsLeft: giftsLeft,
    currentRound: currentRound,
    totalRounds: totalRounds,
    rounds: rounds.items,
  );

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