package com.red.circle.other.inner.enums.game;

import java.util.Optional;

/**
 * 游戏pk类型.
 *
 * @author pengshigang on 2022/01/18
 */
public enum GamePkTypeEnum {

  /**
   * 1 vs 1.
   */
  ONE_VS_ONE,

  /**
   * 房间pk.
   */
  ROOM_VS_ROOM,

  /**
   * 房间 1 vs 1.
   */
  ROOM_ONE_VS_ONE,
  ;

  /**
   * 1 vs 1.
   */
  public static String getKey(String gameType) {
    return Optional.ofNullable(gameType).map(type -> GamePkTypeEnum.valueOf(type).name())
        .orElse(GamePkTypeEnum.ONE_VS_ONE.name());
  }

}
