Skip to content
Snippets Groups Projects
Commit 1f86ac1a authored by HUONG THOMAS's avatar HUONG THOMAS
Browse files

Merge branch 'master' into 'master'

Ajout du squelette pour la classe GameControleur

See merge request deleted_user_177013/t4-foc21!9
parents 734c27b8 a3745341
No related merge requests found
......@@ -4,7 +4,74 @@ using System.Text;
namespace fichier1.Controllers
{
class GameController
public class GameController : IGameController
{
public GameController()
{
}
/// <summary>
/// Recupere le mot suivant a decouper
/// </summary>
/// <returns>Un tableau contenant un string, representant un string pret a etre decoupe</returns>
public string[] getMotSuivant()
{
// TODO: implement
return null;
}
/// <summary>
/// Valide le mot et l'envoie au model
/// </summary>
/// <param name="mot"></param>
public void validerMot(string[] mot)
{
// TODO: implement
}
/// <summary>
/// Recupere un mot decoupe auparavant
/// </summary>
/// <param name="nb">numero du mot a recuperer</param>
/// <returns>un tableau de string des morceaux de mot decoupes</returns>
public string[] getMot(int nb)
{
// TODO: implement
return null;
}
/// <summary>
/// Recupe la correction d'un mot
/// </summary>
/// <param name="nb">numero du mot corrige a recuperer</param>
/// <returns>un tableau de string des morceaux de mot decoupes</returns>
public string[] getCorrection(int nb)
{
// TODO: implement
return null;
}
/// <summary>
/// Recupere le numero du mot courrant pendant la partie
/// </summary>
/// <returns>numero du mot</returns>
public int getCurrentWordNumber()
{
// TODO: implement
return 0;
}
/// <summary>
/// Recupere le nombre total de mots dans la partie
/// </summary>
/// <returns>nombre total de mots</returns>
public int getTotalWordNumber()
{
// TODO: implement
return 0;
}
}
}
namespace fichier1.Controllers
{
public interface IGameController
{
string[] getCorrection(int nb);
int getCurrentWordNumber();
string[] getMot(int nb);
string[] getMotSuivant();
int getTotalWordNumber();
void validerMot(string[] mot);
}
}
\ No newline at end of file
using fichier1.Data;
using System.Collections.Generic;
namespace fichier1
{
public interface IService
{
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using fichier1.Controllers;
namespace fichier1
{
......@@ -33,7 +34,7 @@ namespace fichier1
Application.SetCompatibleTextRenderingDefault(false);
//serviceCollection.AddSingleton<Form1>();
serviceCollection.AddScoped<IService, Service>();
serviceCollection.AddScoped<IGameController, GameController>();
ServiceProvider = serviceCollection.BuildServiceProvider();
ServiceProvider.GetRequiredService<BddContext>().Database.EnsureCreated();
......
using fichier1.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace fichier1
{
public class Service : IService
{
private readonly BddContext context;
public Service(BddContext context)
{
this.context = context;
}
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment