onUserJoinBattle method

void onUserJoinBattle(
  1. String battleId,
  2. TUIBattleUser battleUser
)

Implementation

void onUserJoinBattle(String battleId, TUIBattleUser battleUser) {
  if (battleId != battleState.battleId.value) {
    return;
  }
  final newBattleUsers = battleState.battleUsers.value.toList();
  newBattleUsers.add(BattleUser.fromTUIBattleUser(battleUser));
  battleState.battleUsers.value = newBattleUsers;
}