Class RoundBasedSession
A wrapper class for communicating with the VISAB WebApi in round based games.
Inherited Members
Namespace: VISABConnector
Assembly: VISABConnector.dll
Syntax
public static class RoundBasedSession
Properties
| Improve this Doc View SourceSession
The underylying session that is used.
Declaration
public static IVISABSession Session { get; }
Property Value
Type | Description |
---|---|
IVISABSession |
Methods
| Improve this Doc View SourceCloseSessionAsync()
Closes the active session.
Declaration
public static async Task<bool> CloseSessionAsync()
Returns
Type | Description |
---|---|
Task<Boolean> | True if session was closed |
GetFileAsync()
Receives the written json file for the session.
Declaration
public static async Task<string> GetFileAsync()
Returns
Type | Description |
---|---|
Task<String> | The written json file if successfully retrieved, empty string else |
SendImagesAsync(IImageContainer)
Sends images using the current session.
Declaration
public static async Task<bool> SendImagesAsync(IImageContainer image)
Parameters
Type | Name | Description |
---|---|---|
IImageContainer | image | The image to send |
Returns
Type | Description |
---|---|
Task<Boolean> | True if successfully sent |
SendStatisticsAsync(IStatistics)
Sends statistics using the current session.
Declaration
public static async Task<bool> SendStatisticsAsync(IStatistics statistics)
Parameters
Type | Name | Description |
---|---|---|
IStatistics | statistics | The statistics to send |
Returns
Type | Description |
---|---|
Task<Boolean> | True if successfully sent |
StartSessionAsync(String, String, Int32, Int32)
Starts a VISAB WebApi session.
Declaration
public static async Task<bool> StartSessionAsync(string game, string hostAdress = "http://localhost", int port = 2673, int requestTimeout = 5)
Parameters
Type | Name | Description |
---|---|---|
String | game | The game for which to start the session |
String | hostAdress | The hostAdress of the VISAB WebApi |
Int32 | port | The port of the VISAB WebApi |
Int32 | requestTimeout | The request timeout to use |
Returns
Type | Description |
---|---|
Task<Boolean> | True if session was started |
StartSessionAsync(IMetaInformation, String, Int32, Int32)
Starts a VISAB WebApi session.
Declaration
public static async Task<bool> StartSessionAsync(IMetaInformation metaInformation, string hostAdress = "http://localhost", int port = 2673, int requestTimeout = 5)
Parameters
Type | Name | Description |
---|---|---|
IMetaInformation | metaInformation | The metainformation with which to initialize the session |
String | hostAdress | The hostAdress of the VISAB WebApi |
Int32 | port | The port of the VISAB WebApi |
Int32 | requestTimeout | The request timeout to use |
Returns
Type | Description |
---|---|
Task<Boolean> | True if session was started |
Events
| Improve this Doc View SourceMessageAddedEvent
Event that will be invoked when a log message should be written. The argument contains the message.
Declaration
public static event Action<string> MessageAddedEvent
Event Type
Type | Description |
---|---|
Action<String> |