Skip to content

kawinupra/Werewolf-Project

Repository files navigation

WerewolfClient - the C# Desktop Application for the Werewolf Game

This is a werewolf game client primarily developed for CPE200 class at Computer Engineering, Chiang Mai University.

This C# SDK is automatically generated by the Swagger Codegen project:

  • API version: 0.1.0
  • SDK version: 1.0.0
  • Build package: io.swagger.codegen.languages.CSharpClientCodegen

Frameworks supported

  • .NET 4.0 or later

Dependencies

The DLLs included in the package may not be the latest version. We recommend using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

Load the project into your Visual Studio and run it from there.

Werewolf API

Information about Werewolf API used by this application to connect to the server.

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class Example
    {
        public void main()
        {

            var apiInstance = new ActionApi();

            try
            {
                // Get list of actions
                List<Action> result = apiInstance.ActionGet();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ActionApi.ActionGet: " + e.Message );
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://project-ile.net:1038/v1

Class Method HTTP request Description
ActionApi ActionGet GET /action Get list of actions
ActionApi FindActionsByRoleId GET /action/findByRole/{roleId} Finds actions by roleId
ActionApi GetActionById GET /action/{actionID} Find action by ID
ChatApi ChatGameIDSessionIDChatIDGet GET /chat/{gameID}/{sessionID}/{chatID} Retrieve list of chat messages
ChatApi ChatGameIDSessionIDPost POST /chat/{gameID}/{sessionID} Post a message to game
GameApi GameActionSessionIDActionIDTargetIDPost POST /game/action/{sessionID}/{actionID}/{targetID} Perform action on a game
GameApi GameGet GET /game Get list of games
GameApi GameSessionSessionIDDelete DELETE /game/session/{sessionID} Leave a game
GameApi GameSessionSessionIDGet GET /game/session/{sessionID} Get game session
GameApi GameSessionSessionIDPost POST /game/session/{sessionID} Join a game
GameApi GetGameById GET /game/{gameId} Find game by ID
PlayerApi AddPlayer POST /player Add a new player to the system
PlayerApi DeletePlayer DELETE /player/{playerId} Deletes a player
PlayerApi FindPlayersByGame GET /player/findByGame/{gameID} Finds Players by game
PlayerApi GetPlayerById GET /player/{playerId} Find player by ID
PlayerApi LoginPlayer POST /player/login Login into a player account
PlayerApi LogoutPlayer GET /player/logout/{sessionID} Player logout
PlayerApi PlayerGet GET /player Get list of players
PlayerApi UpdatePlayer PUT /player Update an existing player
RoleApi GetRoleById GET /role/{roleId} Find role by ID
RoleApi RoleGet GET /role Get list of roles

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published