-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blueprint filename #31
Comments
Given how many times the file name is being defined in the code I suggest splitting the file name generation code into its own separate function e.g.: .get_tamRgo_file <- function() {
file.path(tools::R_user_dir("tamRgo", which = "data"), "tamRgo_genome.rds")
} You could also add in a validation check: .get_tamRgo_file <- function() {
my_tamRgo <- file.path(tools::R_user_dir("tamRgo", which = "data"), "tamRgo_genome.rds")
if (!file.exists(my_tamRgo)) {
stop("No TamRgo found on this computer")
} else {
return(my_tamRgo)
}
} |
Appreciate that |
@mattkerlogue: Aye, agree on simplifying current blueprint gathering function. Definitely some refactoring to apply here. I was thinking about this in terms of checks previously (see #12), but I think there's definitely scope for extending utils.R to cover a lot more of the generalised tasks, like fetching blueprints, etc. And yes, you're right, initially I was thinking in terms of 'oh, this file is being saved within the {tamRgo} files, so i don't need to think too hard about what the actual file is called', but I think some more specificity cannot hurt. Part of me wants to force some old-school limitations. For example, pet name, which I think I set artificially to 8 characters only. Another forced limitation would be to have only one pet at a time, so the blueprint filename wouldn't matter that much; any new pet overwrites the old one. I think this is a nice psychological thing; this is your pet, would you be so heartless as to replace them? But maybe it would be fun to have like 'save slots' so you can have 'up to three' pets or whatever. (Of course, none of this matters, because it's a proof of concept that no-one will ever play, lol. Although my sweet KEVIN has reached 19 days old and I love him and cannot let him reach a state of unalive.) |
Hold your |
|
Or: bp$dead$is_dead <- TRUE
bp$dead$cause <- sample(
c(
"hunger", # unfed for X days
"despair", # 0 happiness for X days
"dysentery", # unclean for X days
"killed"), # died in battle
1) |
Listen, the {tamRgo} repo is a serious place with well-structured discussion; you just going to ignore #23? Also I like the idea of:
|
Hah. My apologies for not having undertaken a comprehensive survey of all extant issues. |
Suggest making
blueprint.rds
file name more explicitly linked to the package. It's unlikely you're going to run into conflicts butblueprint.rds
is a fairly generic name. SuggesttamRgo_blueprint.rds
, or perhaps something more connected to the game concept such astamRgo_genome.rds
ortamRgo_egg.rds
.tamRgo/R/blueprints.R
Line 133 in 2c246bf
tamRgo/R/blueprints.R
Line 204 in 2c246bf
tamRgo/R/utils.R
Line 18 in 2c246bf
tamRgo/R/zzz.R
Line 4 in fc0d639
tamRgo/R/interact.R
Line 173 in 2c246bf
tamRgo/R/update.R
Line 39 in 5c7601c
The text was updated successfully, but these errors were encountered: