You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.3 KiB

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace WebApplication1.Controllers
{
[Route("api/v2/[controller]")]
[ApiController]
public class Field2Controller : ControllerBase
{
private IFieldManager _fm;
private ILogger<FieldController> _lg;
/// <summary>
/// .ctor
/// </summary>
/// <param name="fm"></param>
public Field2Controller(
IFieldManager fm,
ILogger<FieldController> lg)
{
_fm = fm;
_lg = lg;
}
[HttpPost(Name = "new")]
[Route("new")]
public Field StartNewGame()
{
return _fm.StartNewGame();
}
[HttpPost(Name = "move")]
[Route("move")]
public Field Move(string identifier)
{
return _fm.Move(identifier);
}
[HttpPost(Name = "move2")]
[Route("move2")]
public Field Move2(string identifier)
{
return _fm.Move(identifier);
}
[HttpGet(Name = "list")]
[Route("list")]
public Field List(string identifier)
{
return _fm.List(identifier);
}
}
}