-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from rakaly/tokens1
Swap compile time tokens to embedded runtime decoding
- Loading branch information
Showing
7 changed files
with
56 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
/target | ||
assets/tokens/*.txt | ||
assets/tokens |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
mod errors; | ||
mod file; | ||
mod melter; | ||
mod tokens; | ||
|
||
use crate::errors::LibError; | ||
use errors::PdsError; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
pub fn eu4_tokens_resolver() -> eu4save::BasicTokenResolver { | ||
let data = include_bytes!("../assets/tokens/eu4.txt"); | ||
eu4save::BasicTokenResolver::from_text_lines(&data[..]).expect("embedded tokens invalid format") | ||
} | ||
|
||
pub fn ck3_tokens_resolver() -> ck3save::BasicTokenResolver { | ||
let data = include_bytes!("../assets/tokens/ck3.txt"); | ||
ck3save::BasicTokenResolver::from_text_lines(&data[..]).expect("embedded tokens invalid format") | ||
} | ||
|
||
pub fn vic3_tokens_resolver() -> vic3save::BasicTokenResolver { | ||
let data = include_bytes!("../assets/tokens/vic3.txt"); | ||
vic3save::BasicTokenResolver::from_text_lines(&data[..]) | ||
.expect("embedded tokens invalid format") | ||
} | ||
|
||
pub fn imperator_tokens_resolver() -> imperator_save::BasicTokenResolver { | ||
let data = include_bytes!("../assets/tokens/imperator.txt"); | ||
imperator_save::BasicTokenResolver::from_text_lines(&data[..]) | ||
.expect("embedded tokens invalid format") | ||
} | ||
|
||
pub fn hoi4_tokens_resolver() -> hoi4save::BasicTokenResolver { | ||
let data = include_bytes!("../assets/tokens/hoi4.txt"); | ||
hoi4save::BasicTokenResolver::from_text_lines(&data[..]) | ||
.expect("embedded tokens invalid format") | ||
} |