use std::path::Path;

use self::files::{Files, OpenFileError};

mod error;
mod files;

struct World;

impl World {
    pub fn new(entry_point: &Path) -> Result<Self, WorldCreationError> {
        let mut files = Files::default();
        let (entry_point_id, errors) = files.add_file(entry_point)?;

        todo!()
    }
}

enum WorldCreationError {
    FailedToOpenEntryPoint(OpenFileError),
}

impl From<OpenFileError> for WorldCreationError {
    fn from(value: OpenFileError) -> Self {
        Self::FailedToOpenEntryPoint(value)
    }
}
