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.

34 lines
856 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace WebApplication1
{
public class FieldManager : IFieldManager
{
private List<Field> _fields = new List<Field>();
public Field StartNewGame()
{
var ff = new RandomField(2);
_fields.Add(ff);
return ff;
}
public Field Move(string identifier)
{
var ff = _fields.FirstOrDefault(f => f.identifier.Equals(identifier));
if (ff == null) return null;
ff.MoveRandomFigure();
return ff;
}
public Field List(string identifier)
{
var ff = _fields.FirstOrDefault(f => f.identifier.Equals(identifier));
if (ff == null) return null;
return ff;
}
}
}