using AC2RE.Definitions;

namespace LandblockExtraction.DatEngine {
    public class CellEngine {
        private DatReader cellReader;

        public CellEngine() {
            cellReader = new(@"X:\DatFiles\cell_1.dat");
        }

        public CLandBlockData? GetLandBlockData(uint id) {
            DataId dataId = new DataId(id);
            if (!cellReader.contains(dataId)) return null;
            using (var data = cellReader.getFileReader(dataId)) {
                CLandBlockData cLandBlockData = new(data);
                return cLandBlockData;
            }
        }
    }
}
