﻿using System;
using System.Collections.Generic;
using System.Linq;
using RogueEngine.Core.Contracts;
using RogueEngine.Core.Contracts.DataAccess;

namespace RogueEngine.DataAccess
{
    public class UnitRepository : IUnitRepository
    {
        private readonly List<IUnit> units = new List<IUnit>
        {
            new Unit {ID = Guid.NewGuid(), FirstName = "John", LastName = "Doe"},
            new Unit {ID = Guid.NewGuid(), FirstName = "Jane", LastName = "Doe"}
        };

        public IEnumerable<IUnit> GetAllUnits()
        {
            return this.units.ToList();
        }

        public IUnit GetUnitById(Guid id)
        {
            return this.units.SingleOrDefault(u => u.ID.Equals(id));
        }
    }
}
