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.app.AppRoomIdCmd;
import com.red.circle.other.app.command.game.ludo.GameJoinCmdExe;
import com.red.circle.other.app.command.game.turntable.GameTurntableCreateCmdExe;
import com.red.circle.other.app.command.game.turntable.GameTurntableProcessingQueryExe;
import com.red.circle.other.app.command.game.turntable.GameTurntableProcessingStatusCmdExe;
import com.red.circle.other.app.command.game.turntable.GameTurntableStartCmdExe;
import com.red.circle.other.app.command.game.turntable.GameTurntableTopListQueryCmdExe;
import com.red.circle.other.app.dto.clientobject.game.GameUserCO;
import com.red.circle.other.app.dto.clientobject.game.RoomTurntableGameCO;
import com.red.circle.other.app.dto.cmd.game.GameTurntableCreateCmd;
import com.red.circle.other.app.dto.cmd.game.GameTurntableGameIdCmd;
import com.red.circle.other.app.dto.cmd.game.GameTurntableProcessingStatusCmd;
import com.red.circle.wallet.inner.model.dto.WalletReceiptDTO;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 游戏相关.
 *
 * @author houyong on 2021/2/1
 */
@Service
@RequiredArgsConstructor
public class GameTurntableServiceImpl implements GameTurntableService {

  private final GameJoinCmdExe gameJoinCmdExe;
  private final GameTurntableStartCmdExe gameTurntableStartCmdExe;
  private final GameTurntableCreateCmdExe gameTurntableCreateCmdExe;
  private final GameTurntableTopListQueryCmdExe gameTurntableTopListQueryCmdExe;
  private final GameTurntableProcessingQueryExe gameTurntableProcessingQueryExe;
  private final GameTurntableProcessingStatusCmdExe gameTurntableProcessingStatusCmdExe;

  @Override
  public RoomTurntableGameCO create(GameTurntableCreateCmd cmd) {
    return gameTurntableCreateCmdExe.execute(cmd);
  }

  @Override
  public WalletReceiptDTO join(GameTurntableGameIdCmd cmd) {
    return gameJoinCmdExe.execute(cmd);
  }

  @Override
  public RoomTurntableGameCO start(GameTurntableGameIdCmd cmd) {
    return gameTurntableStartCmdExe.execute(cmd);
  }

  @Override
  public RoomTurntableGameCO getProcessingGame(AppRoomIdCmd cmd) {
    return gameTurntableProcessingQueryExe.execute(cmd);
  }

  @Override
  public void processingStatus(GameTurntableProcessingStatusCmd cmd) {
    gameTurntableProcessingStatusCmdExe.execute(cmd);
  }

  @Override
  public List<GameUserCO> listTop(AppExtCommand cmd) {
    return gameTurntableTopListQueryCmdExe.execute(cmd);
  }
}
