package com.red.circle.other.app.service.game;


import com.red.circle.common.business.dto.cmd.AppExtCommand;
import com.red.circle.common.business.dto.cmd.IdLongCmd;
import com.red.circle.common.business.dto.cmd.RoomIdCmd;
import com.red.circle.common.business.dto.cmd.RoomIdLastIdCmd;
import com.red.circle.other.app.command.game.roompk.GameRoomPkAcceptCmdExe;
import com.red.circle.other.app.command.game.roompk.GameRoomPkAwaitListCmdExe;
import com.red.circle.other.app.command.game.roompk.GameRoomPkOverCmdExe;
import com.red.circle.other.app.command.game.roompk.GameRoomPkProposalCmdExe;
import com.red.circle.other.app.command.game.roompk.GameRoomPkRankingCmdExe;
import com.red.circle.other.app.command.game.roompk.GameRoomPkStartedListCmdExe;
import com.red.circle.other.app.command.game.roompk.GameRoomPkUserCmdExe;
import com.red.circle.other.app.command.game.roompk.GameRoomPkWinnerListCmdExe;
import com.red.circle.other.app.command.game.roompk.RewardPoolQryExe;
import com.red.circle.other.app.dto.clientobject.activity.RewardPoolCO;
import com.red.circle.other.app.dto.clientobject.game.GameRoomPkAwaitListCO;
import com.red.circle.other.app.dto.clientobject.game.GameRoomPkH5DataCO;
import com.red.circle.other.app.dto.clientobject.game.GameRoomPkStartedListCO;
import com.red.circle.other.app.dto.clientobject.game.GameRoomPkUserCO;
import com.red.circle.other.app.dto.clientobject.game.GameRoomPkWinnerCO;
import com.red.circle.other.app.dto.cmd.activity.RewardPoolCmd;
import com.red.circle.other.app.dto.cmd.game.roompk.GameRoomPkAcceptCmd;
import com.red.circle.other.app.dto.cmd.game.roompk.GameRoomPkProposalCmd;
import java.util.List;
import java.util.Set;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 房间PK.
 * </p>
 *
 * @author pengshigang
 * @since 2021-09-24
 */
@Service
@RequiredArgsConstructor
public class GameRoomPkServiceImpl implements GameRoomPkService {

  private final RewardPoolQryExe rewardPoolQryExe;
  private final GameRoomPkOverCmdExe gameRoomPkOverCmdExe;
  private final GameRoomPkUserCmdExe gameRoomPkUserCmdExe;
  private final GameRoomPkAcceptCmdExe gameRoomPkAcceptCmdExe;
  private final GameRoomPkRankingCmdExe gameRoomPkRankingCmdExe;
  private final GameRoomPkProposalCmdExe gameRoomPkProposalCmdExe;
  private final GameRoomPkAwaitListCmdExe gameRoomPkAwaitListCmdExe;
  private final GameRoomPkWinnerListCmdExe gameRoomPkWinnerListCmdExe;
  private final GameRoomPkStartedListCmdExe gameRoomPkStartedListCmdExe;

  @Override
  public void proposalPk(GameRoomPkProposalCmd cmd) {
    gameRoomPkProposalCmdExe.execute(cmd);
  }

  @Override
  public void acceptPk(GameRoomPkAcceptCmd cmd) {
    gameRoomPkAcceptCmdExe.execute(cmd);
  }

  @Override
  public void voluntarilyEndPk(IdLongCmd cmd) {
    gameRoomPkOverCmdExe.execute(cmd);
  }

  @Override
  public List<GameRoomPkAwaitListCO> listAwaitPk(RoomIdLastIdCmd cmd) {
    return gameRoomPkAwaitListCmdExe.execute(cmd);
  }

  @Override
  public Set<GameRoomPkStartedListCO> listStartedPk(RoomIdLastIdCmd cmd) {
    return gameRoomPkStartedListCmdExe.execute(cmd);
  }

  @Override
  public List<GameRoomPkWinnerCO> latestWinnerUser(AppExtCommand cmd) {
    return gameRoomPkWinnerListCmdExe.execute(cmd);
  }

  @Override
  public GameRoomPkUserCO roomPkUser(RoomIdCmd cmd) {
    return gameRoomPkUserCmdExe.execute(cmd);
  }

  @Override
  public GameRoomPkH5DataCO rankingData(AppExtCommand cmd) {
    return gameRoomPkRankingCmdExe.execute(cmd);
  }

  @Override
  public List<RewardPoolCO> listRewardPool(RewardPoolCmd cmd) {
    return rewardPoolQryExe.execute(cmd);
  }

}
