Skip to content
Snippets Groups Projects
Commit 46d45a19 authored by thibault's avatar thibault
Browse files

Rajout pour TP2 WPF

parent ea62a330
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
......@@ -66,17 +66,17 @@ namespace WebApiGot.Controllers
if(Request.Form["strength"] != null)
{
TournamentManager.Instance.setCharacterBravoury(id, Int32.Parse(Request.Form["strength"]));
TournamentManager.Instance.setCharacterStrength(id, Int32.Parse(Request.Form["strength"]));
}
if(Request.Form["health"] != null)
{
TournamentManager.Instance.setCharacterBravoury(id, Int32.Parse(Request.Form["health"]));
TournamentManager.Instance.setCharacterHealth(id, Int32.Parse(Request.Form["health"]));
}
if (Request.Form["crazyness"] != null)
{
TournamentManager.Instance.setCharacterBravoury(id, Int32.Parse(Request.Form["crazyness"]));
TournamentManager.Instance.setCharacterCrazyness(id, Int32.Parse(Request.Form["crazyness"]));
}
return Json(new CharacterDTO(TournamentManager.Instance.getCharacterById(id)), JsonRequestBehavior.AllowGet);
......
......@@ -11,6 +11,12 @@ namespace WebApiGot.Models
[Serializable]
public class CharacterDTO
{
private int id;
public int ID
{
get { return id; }
set { id = value; }
}
private int bravoury;
public int Bravoury
{
......@@ -56,6 +62,7 @@ namespace WebApiGot.Models
public CharacterDTO(Character c)
{
id = c.ID;
bravoury = c.bravoury;
crazyness = c.crazyness;
strength = c.strength;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment