﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Juego.Logic
{
    public class Game
    {
        private static readonly List<int> Solution = new List<int>{1,2,3,4,5,6,7,8,0};
        private List<int> _current =  new List<int>();
        

        public List<int> Current
        {
            get { return _current; }
            set { _current = value; }
        }

        public void StartGame()
        {
            CreateRandomBoard();
        }

        public bool CheckBoard()
        {
            return Solution.SequenceEqual(_current);
        }

        private void CreateRandomBoard()
        {
            var rnd = new Random();
            var randomNumbers = Enumerable.Range(0, 9).OrderBy(x => rnd.Next()).Take(9).ToList();
            _current = randomNumbers;
        }
    }
}