29 lines
836 B
Rust
29 lines
836 B
Rust
use std::path::PathBuf;
|
|
use crate::prelude::*;
|
|
|
|
/// Provides paths to the BIOS ROMs, core library, assets, and saves to cores that need them.
|
|
#[derive(Default)]
|
|
pub struct PathBufComponent {
|
|
pub sys_path: Option<PathBuf>,
|
|
pub libretro_path: Option<PathBuf>,
|
|
pub core_assets_path: Option<PathBuf>,
|
|
pub save_path: Option<PathBuf>,
|
|
}
|
|
|
|
impl RetroComponent for PathBufComponent {}
|
|
|
|
impl RetroCallbacks for PathBufComponent {
|
|
fn get_system_directory(&mut self) -> Option<PathBuf> {
|
|
self.sys_path.clone()
|
|
}
|
|
fn get_libretro_path(&mut self) -> Option<PathBuf> {
|
|
self.libretro_path.clone()
|
|
}
|
|
fn get_core_assets_directory(&mut self) -> Option<PathBuf> {
|
|
self.core_assets_path.clone()
|
|
}
|
|
fn get_save_directory(&mut self) -> Option<PathBuf> {
|
|
self.save_path.clone()
|
|
}
|
|
}
|