using OrderCriterias;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ManagerInterfaces
{
///
/// All methods to handle players
/// /!\ all methods returns a task
///
/// a DTO, Entity or Model player
public interface IPlayerManager
{
///
/// get the number of players
///
/// the number of players
public int getNbPlayers();
///
/// add a player
///
/// the player to add
///
/// the player that corresponde to
/// the player added or the player equal to this
/// player if this player was already added
///
public Task addPlayer(T player);
///
/// remove a player
///
/// the player to remove
///
/// the player removed or null if
/// the player does not exist
///
public Task removePlayer(T player);
///
/// remove a player
///
/// the identifier of the player to remove
///
/// the player removed or null if
/// the player does not exist
///
Task removePlayer(int id);
///
/// get a part of all players
///
/// the actual page
/// number of players in a page
/// the order criteria
///
/// a set of the number of page and
/// all players in the database for
/// the page nb (or null if the page
/// does not exist (<=> (nb-1)*count outside
/// boundaries (0, getNbElement()-1)))
///
public Task<(int nbPages, IEnumerable? players)> getPlayers(int nb, int count, PlayerOrderCriteria orderCriteria = PlayerOrderCriteria.ById);
///
/// get a player
///
/// identifier of the player
///
/// the player with this id
/// or null if no player match
/// with this id
///
public Task getPlayer(int id);
///
/// get a player
///
/// nickname of the player
///
/// the player with this nickname
/// or null if no player match
/// with this nickname
///
public Task getPlayer(string nickname);
///
/// get players in a lobby
///
/// the id of the lobby they are inside
///
/// a set of all players in this lobby
/// (we know that the lobby is at less
/// used by the creator) or null (and
/// delete the lobby) if it is used by
/// no player
///
public Task?> getPlayersInALobby(int idLobby);
///
/// get the max score of a player in a chapter
///
/// identifier of the player
/// identifier of the chapter
///
/// the max score of the player
/// or null if the player or
/// the chapter does not exist
///
public Task getMaxScorePlayer(int id, int idChapter);
///
/// get the global max score of a player
///
/// identifier of the player
///
/// the max score of the player
/// or null if the player does not exist
///
public Task getMaxScorePlayer(int id);
///
/// update a player
///
/// the id of the player to update
/// a player class which contains all properties to changes
///
/// the player changed or null
/// if the id doesn't exist or
/// if the player nickname is
/// already used
///
public Task updatePlayer(int id, T player);
}
}