// SPDX-License-Identifier: CC0-1.0
pragmasolidity>=0.8.0;import"./Types.sol";interfaceIMOG{/**
* Create a new room.
* @dev The entity MUST be assigned a unique Id.
* @return New room id.
*/functioncreateRoom()externalreturns(uint256);/**
* Get the total number of rooms that have been created.
* @return Total number of rooms.
*/functiongetRoomCount()externalviewreturns(uint256);/**
* Player joins room.
* @dev The member MUST be assigned a unique Id.
* @param _roomId is the id of the room.
* @return Member id.
*/functionjoinRoom(uint256_roomId)externalreturns(uint256);/**
* Get the id of a member in a room.
* @param _roomId is the id of the room.
* @param _member is the address of a member.
* @return Member id.
*/functiongetMemberId(uint256_roomId,address_member)externalviewreturns(uint256);/**
* Check if a member exists in the room.
* @param _roomId is the id of the room.
* @param _member is the address of a member.
* @return true exists, false does not exist.
*/functionhasMember(uint256_roomId,address_member)externalviewreturns(bool);/**
* Get all room IDs joined by a member.
* @param _member is the address of a member.
* @return An array of room ids.
*/functiongetRoomIds(address_member)externalviewreturns(uint256[]memory);/**
* Get the total number of members in a room.
* @param _roomId is the id of the room.
* @return Total members.
*/functiongetMemberCount(uint256_roomId)externalviewreturns(uint256);/**
* A member sends a message to other members.
* @dev Define your game logic here and use the content in the message to handle the member's state. The message MUST be assigned a unique Id
* @param _roomId is the id of the room.
* @param _to is an array of other member ids.
* @param _message is the content of the message, encoded by abi.encode.
* @param _messageTypes is data type array of message content.
* @return Message id.
*/functionsendMessage(uint256_roomId,uint256[]memory_to,bytesmemory_message,Types.Type[]memory_messageTypes)externalreturns(uint256);/**
* Get all messages received by a member in the room.
* @param _roomId is the id of the room.
* @param _memberId is the id of the member.
* @return An array of message ids.
*/functiongetMessageIds(uint256_roomId,uint256_memberId)externalviewreturns(uint256[]memory);/**
* Get details of a message.
* @param _roomId is the id of the room.
* @param _messageId is the id of the message.
* @return The content of the message.
* @return Data type array of message content.
* @return Sender id.
* @return An array of receiver ids.
*/functiongetMessage(uint256_roomId,uint256_messageId)externalviewreturns(bytesmemory,Types.Type[]memory,uint256,uint256[]memory);}