using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ParticulateSensorRecords
{
    public class Work
    {
        public ConfigRecord configRecord { get; private set; } // Data used when this work is processed - config record
        private IFileReader IOhandler; // Data used when this work is processed - config record

        public Work(ConfigRecord data, IFileReader IOhandler) //extra param for IFileReader and ConfigRecord
        {
            this.configRecord = data; // Data is initialised when the work is instantiated
            this.IOhandler = IOhandler;
        }

        public Location ReadData()
        {
            // Reads the specified file and extracts the location data from it to store in a location object.
            // Note that result remains null until this method is executed
            return IOhandler.ReadDataFromFile(configRecord);
        }
    }
}
