From e9ea621b93fbb58d9edfca8375918791637bbd52 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 30 Dec 2020 20:59:04 +0800 Subject: +init --- Impostor-dev/src/Impostor.Api/Games/IGame.cs | 88 ++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 Impostor-dev/src/Impostor.Api/Games/IGame.cs (limited to 'Impostor-dev/src/Impostor.Api/Games/IGame.cs') diff --git a/Impostor-dev/src/Impostor.Api/Games/IGame.cs b/Impostor-dev/src/Impostor.Api/Games/IGame.cs new file mode 100644 index 0000000..ad71986 --- /dev/null +++ b/Impostor-dev/src/Impostor.Api/Games/IGame.cs @@ -0,0 +1,88 @@ +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; +using Impostor.Api.Innersloth; +using Impostor.Api.Net; +using Impostor.Api.Net.Inner; +using Impostor.Api.Net.Inner.Objects; +using Impostor.Api.Net.Messages; + +namespace Impostor.Api.Games +{ + public interface IGame + { + GameOptionsData Options { get; } + + GameCode Code { get; } + + GameStates GameState { get; } + + IGameNet GameNet { get; } + + IEnumerable Players { get; } + + IPEndPoint PublicIp { get; } + + int PlayerCount { get; } + + IClientPlayer Host { get; } + + bool IsPublic { get; } + + IDictionary Items { get; } + + int HostId { get; } + + IClientPlayer GetClientPlayer(int clientId); + + /// + /// Adds an to the ban list of this game. + /// Prevents all future joins from this . + /// + /// This does not kick the player with that from the lobby. + /// + /// + /// The to ban. + /// + void BanIp(IPAddress ipAddress); + + /// + /// Syncs the internal to all players. + /// Necessary to do if you modified it, otherwise it won't be used. + /// + /// A representing the asynchronous operation. + ValueTask SyncSettingsAsync(); + + /// + /// Sets the specified list as Impostor on all connected players. + /// + /// List of players to be Impostor. + /// A representing the asynchronous operation. + ValueTask SetInfectedAsync(IEnumerable players); + + /// + /// Send the message to all players. + /// + /// Message to send. + /// Required limbo state of the player. + /// A representing the asynchronous operation. + ValueTask SendToAllAsync(IMessageWriter writer, LimboStates states = LimboStates.NotLimbo); + + /// + /// Send the message to all players except one. + /// + /// Message to send. + /// The player to exclude from sending the message. + /// Required limbo state of the player. + /// A representing the asynchronous operation. + ValueTask SendToAllExceptAsync(IMessageWriter writer, int senderId, LimboStates states = LimboStates.NotLimbo); + + /// + /// Send a message to a specific player. + /// + /// Message to send. + /// ID of the client. + /// A representing the asynchronous operation. + ValueTask SendToAsync(IMessageWriter writer, int id); + } +} -- cgit v1.1-26-g67d0