cpclib_runner/runner/emulator/
caprice_forever.rs1use std::sync::OnceLock;
2
3use crate::delegated::{
4 ArchiveFormat, DownloadableInformation, ExecutableInformation,
5 InternetStaticCompiledApplication, MutiplatformUrls, StaticInformation
6};
7use crate::runner::runner::RunInDir;
8
9pub const CAPRICEFOREVER_CMD: &str = "caprice";
10
11#[derive(Clone, Debug, PartialEq, Eq, Hash, Default)]
12pub enum CapriceForeverVersion {
13 #[default]
14 V25_3
15}
16
17impl InternetStaticCompiledApplication for CapriceForeverVersion {}
18
19impl ExecutableInformation for CapriceForeverVersion {
20 fn target_os_folder(&self) -> &'static str {
21 match self {
22 Self::V25_3 => "CapriceForever_25.3"
23 }
24 }
25
26 fn target_os_exec_fname(&self) -> &'static str {
27 match self {
28 Self::V25_3 => {
29 #[cfg(target_os = "windows")]
30 return "Caprice64.exe";
31 #[cfg(target_os = "linux")]
32 unreachable!();
33 #[cfg(target_os = "macosx")]
34 unreachable!();
35 }
36 }
37 }
38
39 fn target_os_run_in_dir(&self) -> RunInDir {
40 RunInDir::AppDir
41 }
42}
43
44impl StaticInformation for CapriceForeverVersion {
45 fn static_download_urls(&self) -> &'static MutiplatformUrls {
46 match self {
47 CapriceForeverVersion::V25_3 => {
48 static URLS: OnceLock<MutiplatformUrls> = OnceLock::new();
49 URLS.get_or_init(|| MutiplatformUrls::builder().windows("https://www.cpc-power.com/cpcarchives/download/Emulateurs/%5BWin64%5D%20Caprice_Forever_v25.3.7z").build())
50 }
51 }
52 }
53}
54
55impl DownloadableInformation for CapriceForeverVersion {
56 fn target_os_archive_format(&self) -> ArchiveFormat {
57 ArchiveFormat::SevenZ
58 }
59
60 }