/// <summary> /// Sends a move in to the currently selected game. /// </summary> /// <typeparam name="T">Type of the move.</typeparam> /// <param name="move">The move.</param> /// <returns>True if successful. Otherwise false.</returns> public async Task <bool> SendMoveAsync <T>(T move) where T : BaseMove { DisposeGuard(); if (CurrentGame == null) { return(false); } if (!TryBeginInvoke()) { return(false); } bool result; try { result = await _client.SendMoveAsync(_loginResult?.TokenString, CurrentGame.Id, move); } catch (Exception e) { TryEndInvoke(); OnPollFinished(ServiceConnectionEventArgs.Error(e)); return(false); } if (result) { await PollAsync(); } TryEndInvoke(); return(result); }
public virtual async Task <bool> SendMove <T>(Guid matchId, T move) where T : BaseMove { return(await _client.SendMoveAsync(JwtToken, matchId, move)); }