init method

void init(
  1. String roomId,
  2. GiftUser owner,
  3. GiftUser self
)

Implementation

void init(String roomId, GiftUser owner, GiftUser self) {
  if (this.roomId != roomId ||
      selfInfo.userId != self.userId ||
      ownerInfo.userId != owner.userId) {
    this.roomId = roomId;
    ownerInfo = owner;
    selfInfo = self;
  } else {
    ownerInfo.updateUserInfo(owner);
    selfInfo.updateUserInfo(self);
  }
}