refactor(download manager): Added Downloadable trait and replaced references to GameDownloadAgent

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2024-12-30 20:30:38 +11:00
parent b6c64e56e5
commit b4d70a35b3
5 changed files with 65 additions and 17 deletions

View File

@ -0,0 +1,18 @@
use std::sync::Arc;
use crate::downloads::download_agent::GameDownloadError;
use super::{
download_thread_control_flag::DownloadThreadControl,
progress_object::ProgressObject,
};
pub trait Downloadable: Sync {
fn get_progress_object(&self) -> Arc<ProgressObject>;
fn version(&self) -> String;
fn id(&self) -> String;
fn download(&mut self) -> Result<(), GameDownloadError>;
fn progress(&self) -> Arc<ProgressObject>;
fn control_flag(&self) -> DownloadThreadControl;
fn install_dir(&self) -> String;
}