Class SimpleRoom

java.lang.Object
com.iohao.net.extension.room.SimpleRoom
All Implemented Interfaces:
Room

public class SimpleRoom extends Object implements Room
Default in-memory Room implementation.
Since:
21.8
Author:
渔民小镇
date:
2022-03-31
  • Constructor Details

    • SimpleRoom

      public SimpleRoom()
  • Method Details

    • getPlayerSeatMap

      public Map<Integer,Long> getPlayerSeatMap()
      key: seat, value: userId
      Specified by:
      getPlayerSeatMap in interface Room
      Returns:
      User positions
    • getPlayerMap

      public Map<Long,Player> getPlayerMap()
      Description copied from interface: Room
      Users, including Robot. key : userId
      Specified by:
      getPlayerMap in interface Room
      Returns:
      Users
    • getRealPlayerMap

      public Map<Long,Player> getRealPlayerMap()
      Description copied from interface: Room
      All real users key : userId
      Specified by:
      getRealPlayerMap in interface Room
      Returns:
      Real users
    • getRobotMap

      public Map<Long,Player> getRobotMap()
      Description copied from interface: Room
      All Robots key : userId
      Specified by:
      getRobotMap in interface Room
      Returns:
      Robot Map
    • getOperationService

      public OperationService getOperationService()
      Description copied from interface: Room
      getOperationService
      Specified by:
      getOperationService in interface Room
      Returns:
      OperationService
    • getRoomId

      public long getRoomId()
      Description copied from interface: Room
      get roomId
      Specified by:
      getRoomId in interface Room
      Returns:
      roomId
    • getSpaceSize

      public int getSpaceSize()
      Description copied from interface: Room
      get room space size
      Specified by:
      getSpaceSize in interface Room
      Returns:
      Room space size. For example, 4 means the room can hold a maximum of 4 players.
    • setOperationService

      public void setOperationService(OperationService operationService)
      Description copied from interface: Room
      setOperationService
      Specified by:
      setOperationService in interface Room
      Parameters:
      operationService - operationService
    • setRoomId

      public void setRoomId(long roomId)
      Description copied from interface: Room
      set roomId
      Specified by:
      setRoomId in interface Room
      Parameters:
      roomId - roomId
    • setSpaceSize

      public void setSpaceSize(int spaceSize)
      Description copied from interface: Room
      set room space size
      Specified by:
      setSpaceSize in interface Room
      Parameters:
      spaceSize - spaceSize