From 97ccff1fae7814fa8295b1a14e122d4e5484ed38 Mon Sep 17 00:00:00 2001 From: Lucas Morgan Date: Thu, 4 Mar 2021 20:40:53 -0600 Subject: [PATCH] code cleanup --- Gameboard.ShogiUI.BoardState/Pieces/Knight.cs | 2 -- Gameboard.ShogiUI.BoardState/ShogiBoard.cs | 1 - .../Api/Messages/GetToken.cs | 14 ++++++------- .../Socket/Interfaces/IRequest.cs | 8 ++++---- .../Socket/Interfaces/IResponse.cs | 10 +++++----- .../Socket/Types/ClientActionEnum.cs | 20 +++++++++---------- .../ClientActionHandlers/IActionHandler.cs | 1 - .../Managers/SocketCommunicationManager.cs | 1 - .../Utility/AuthenticatedHttpClient.cs | 8 ++++---- Gameboard.ShogiUI.Sockets/Startup.cs | 12 +++++------ 10 files changed, 36 insertions(+), 41 deletions(-) diff --git a/Gameboard.ShogiUI.BoardState/Pieces/Knight.cs b/Gameboard.ShogiUI.BoardState/Pieces/Knight.cs index efab3aa..5a6cdd1 100644 --- a/Gameboard.ShogiUI.BoardState/Pieces/Knight.cs +++ b/Gameboard.ShogiUI.BoardState/Pieces/Knight.cs @@ -1,7 +1,5 @@ using PathFinding; using System.Collections.Generic; -using System.Linq; -using System.Numerics; namespace Gameboard.ShogiUI.BoardState.Pieces { diff --git a/Gameboard.ShogiUI.BoardState/ShogiBoard.cs b/Gameboard.ShogiUI.BoardState/ShogiBoard.cs index 6242196..8c3653b 100644 --- a/Gameboard.ShogiUI.BoardState/ShogiBoard.cs +++ b/Gameboard.ShogiUI.BoardState/ShogiBoard.cs @@ -3,7 +3,6 @@ using PathFinding; using System; using System.Collections.Generic; using System.Numerics; -using System.Text; namespace Gameboard.ShogiUI.BoardState { diff --git a/Gameboard.ShogiUI.Sockets.ServiceModels/Api/Messages/GetToken.cs b/Gameboard.ShogiUI.Sockets.ServiceModels/Api/Messages/GetToken.cs index e2f3c98..eb59291 100644 --- a/Gameboard.ShogiUI.Sockets.ServiceModels/Api/Messages/GetToken.cs +++ b/Gameboard.ShogiUI.Sockets.ServiceModels/Api/Messages/GetToken.cs @@ -2,13 +2,13 @@ namespace Gameboard.ShogiUI.Sockets.ServiceModels.Api.Messages { - public class GetTokenResponse - { - public Guid OneTimeToken { get; } + public class GetTokenResponse + { + public Guid OneTimeToken { get; } - public GetTokenResponse(Guid token) - { - OneTimeToken = token; - } + public GetTokenResponse(Guid token) + { + OneTimeToken = token; } + } } diff --git a/Gameboard.ShogiUI.Sockets.ServiceModels/Socket/Interfaces/IRequest.cs b/Gameboard.ShogiUI.Sockets.ServiceModels/Socket/Interfaces/IRequest.cs index ce8c0a4..79ec262 100644 --- a/Gameboard.ShogiUI.Sockets.ServiceModels/Socket/Interfaces/IRequest.cs +++ b/Gameboard.ShogiUI.Sockets.ServiceModels/Socket/Interfaces/IRequest.cs @@ -2,8 +2,8 @@ namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Interfaces { - public interface IRequest - { - ClientAction Action { get; set; } - } + public interface IRequest + { + ClientAction Action { get; set; } + } } diff --git a/Gameboard.ShogiUI.Sockets.ServiceModels/Socket/Interfaces/IResponse.cs b/Gameboard.ShogiUI.Sockets.ServiceModels/Socket/Interfaces/IResponse.cs index 8c1bed8..746d3ab 100644 --- a/Gameboard.ShogiUI.Sockets.ServiceModels/Socket/Interfaces/IResponse.cs +++ b/Gameboard.ShogiUI.Sockets.ServiceModels/Socket/Interfaces/IResponse.cs @@ -1,8 +1,8 @@ namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Interfaces { - public interface IResponse - { - string Action { get; } - string Error { get; set; } - } + public interface IResponse + { + string Action { get; } + string Error { get; set; } + } } diff --git a/Gameboard.ShogiUI.Sockets.ServiceModels/Socket/Types/ClientActionEnum.cs b/Gameboard.ShogiUI.Sockets.ServiceModels/Socket/Types/ClientActionEnum.cs index 9e0952e..7b91157 100644 --- a/Gameboard.ShogiUI.Sockets.ServiceModels/Socket/Types/ClientActionEnum.cs +++ b/Gameboard.ShogiUI.Sockets.ServiceModels/Socket/Types/ClientActionEnum.cs @@ -1,13 +1,13 @@ namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types { - public enum ClientAction - { - ListGames, - CreateGame, - JoinGame, - JoinByCode, - LoadGame, - Move, - KeepAlive - } + public enum ClientAction + { + ListGames, + CreateGame, + JoinGame, + JoinByCode, + LoadGame, + Move, + KeepAlive + } } diff --git a/Gameboard.ShogiUI.Sockets/Managers/ClientActionHandlers/IActionHandler.cs b/Gameboard.ShogiUI.Sockets/Managers/ClientActionHandlers/IActionHandler.cs index 20f98ab..24cf9d2 100644 --- a/Gameboard.ShogiUI.Sockets/Managers/ClientActionHandlers/IActionHandler.cs +++ b/Gameboard.ShogiUI.Sockets/Managers/ClientActionHandlers/IActionHandler.cs @@ -1,5 +1,4 @@ using Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types; -using System.Net.WebSockets; using System.Threading.Tasks; namespace Gameboard.ShogiUI.Sockets.Managers.ClientActionHandlers diff --git a/Gameboard.ShogiUI.Sockets/Managers/SocketCommunicationManager.cs b/Gameboard.ShogiUI.Sockets/Managers/SocketCommunicationManager.cs index 3269493..33ec4d2 100644 --- a/Gameboard.ShogiUI.Sockets/Managers/SocketCommunicationManager.cs +++ b/Gameboard.ShogiUI.Sockets/Managers/SocketCommunicationManager.cs @@ -9,7 +9,6 @@ using Newtonsoft.Json; using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Linq; using System.Net.WebSockets; using System.Threading.Tasks; diff --git a/Gameboard.ShogiUI.Sockets/Repositories/Utility/AuthenticatedHttpClient.cs b/Gameboard.ShogiUI.Sockets/Repositories/Utility/AuthenticatedHttpClient.cs index b9b7ba0..3b4067d 100644 --- a/Gameboard.ShogiUI.Sockets/Repositories/Utility/AuthenticatedHttpClient.cs +++ b/Gameboard.ShogiUI.Sockets/Repositories/Utility/AuthenticatedHttpClient.cs @@ -58,7 +58,7 @@ namespace Gameboard.ShogiUI.Sockets.Repositories.Utility this.SetBearerToken(tokenResponse.AccessToken); } - public async new Task GetAsync(string requestUri) + public new async Task GetAsync(string requestUri) { var response = await base.GetAsync(requestUri); if (response.StatusCode == HttpStatusCode.Unauthorized) @@ -73,7 +73,7 @@ namespace Gameboard.ShogiUI.Sockets.Repositories.Utility await response.Content.ReadAsStringAsync()); return response; } - public async new Task PostAsync(string requestUri, HttpContent content) + public new async Task PostAsync(string requestUri, HttpContent content) { var response = await base.PostAsync(requestUri, content); if (response.StatusCode == HttpStatusCode.Unauthorized) @@ -90,7 +90,7 @@ namespace Gameboard.ShogiUI.Sockets.Repositories.Utility await response.Content.ReadAsStringAsync()); return response; } - public async new Task PutAsync(string requestUri, HttpContent content) + public new async Task PutAsync(string requestUri, HttpContent content) { var response = await base.PutAsync(requestUri, content); if (response.StatusCode == HttpStatusCode.Unauthorized) @@ -107,7 +107,7 @@ namespace Gameboard.ShogiUI.Sockets.Repositories.Utility await response.Content.ReadAsStringAsync()); return response; } - public async new Task DeleteAsync(string requestUri) + public new async Task DeleteAsync(string requestUri) { var response = await base.DeleteAsync(requestUri); if (response.StatusCode == HttpStatusCode.Unauthorized) diff --git a/Gameboard.ShogiUI.Sockets/Startup.cs b/Gameboard.ShogiUI.Sockets/Startup.cs index 09805be..8431c68 100644 --- a/Gameboard.ShogiUI.Sockets/Startup.cs +++ b/Gameboard.ShogiUI.Sockets/Startup.cs @@ -1,5 +1,10 @@ -using Gameboard.ShogiUI.Sockets.Repositories.RepositoryManagers; using Gameboard.ShogiUI.Sockets.Extensions; +using Gameboard.ShogiUI.Sockets.Managers; +using Gameboard.ShogiUI.Sockets.Managers.ClientActionHandlers; +using Gameboard.ShogiUI.Sockets.Repositories; +using Gameboard.ShogiUI.Sockets.Repositories.RepositoryManagers; +using Gameboard.ShogiUI.Sockets.Repositories.Utility; +using Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -12,11 +17,6 @@ using Newtonsoft.Json.Serialization; using System; using System.Collections.Generic; using System.Linq; -using Gameboard.ShogiUI.Sockets.Managers; -using Gameboard.ShogiUI.Sockets.Managers.ClientActionHandlers; -using Gameboard.ShogiUI.Sockets.Repositories; -using Gameboard.ShogiUI.Sockets.Repositories.Utility; -using Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types; namespace Gameboard.ShogiUI.Sockets {