Skip to content
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

Replay system part 1 #379

Merged
merged 41 commits into from
Jul 28, 2024
Merged

Replay system part 1 #379

merged 41 commits into from
Jul 28, 2024

Conversation

NQNStudios
Copy link
Collaborator

This is rebased with all the little things fixed.

auto srand_element = pop_next_action("srand");

std::string ts(srand_element->GetText());
srand(atoi(ts.c_str()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing this made me realize that we may want to consider moving away from rand() in favour of a Mersenne twister… but that would be something for a separate PR.

if (file.empty())
file = "BoE";

if (boost::ends_with(file, ".xml"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Boost.Algorithm is a new dependency, right? I don't mind adding it, but it needs to be mentioned in the README.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't need to be added to the setup of the CI for any of the platforms--it must be a dependency of one of the packages we already install.

The readme says

  • Boost - Filesystem and System, plus several header-only
    libraries; if you're picky, you can run scons and see it enumerate exactly which
    libraries are needed

So I think it could fall under that umbrella.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see that the readme is contradicting itself slightly – the vcpkg instructions do enumerate every necessary Boost library, after all. (Though I'm not confident there are no others missing.)

@NQNStudios
Copy link
Collaborator Author

NQNStudios commented Jul 27, 2024 via email

if(t == "load_party") {

if(overall_mode == MODE_STARTUP && t == "startup_button_click"){
eStartButton btn = static_cast<eStartButton>(atoi(next_action->GetText().c_str()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not going to consider this a blocker, but I think it would be better to use the estreams.cpp conversion mechanism here, giving a string representation for each enum value.

@CelticMinstrel
Copy link
Member

Sorry for the false alarm, I was going through it one commit at a time. I think the only thing missing then is that as far as I know there's no documentation that Boost.Algorithm is now used.

@CelticMinstrel
Copy link
Member

I pulled this and verified that it builds on Xcode 12, so I think there's no major issues. (I'd like it to be able to build on Xcode 3, mind you, but I'm not able to verify that right now.)

@CelticMinstrel
Copy link
Member

Another thing I was thinking which is probably better for another PR is that we should probably use a proper command line processing library. Given our existing dependencies, the most logical choices in my mind are:

  • Clara, which is bundled with Catch2 as a required dependency. Using this would mean that Catch is technically needed to build the game in addition to just the tests, though it wouldn't actually use any of the testing mechanisms of Catch.
  • Boost.ProgramOptions, since we're using Boost anyway

That said, I would be open to other possibilities as well. It appears you've chosen to use a subcommand setup (similar to git), and I'm not sure if either of the above libraries can handle that sort of thing. (Boost is more likely to be able to, but I haven't looked.)

@CelticMinstrel
Copy link
Member

Okay, I think I'm going to go ahead and merge this, but you certainly should add Boost.Algorithm to the README at some point (in the vcpkg install line, maybe also in the place that currently can't be bothered to enumerate the dependencies).

@CelticMinstrel CelticMinstrel merged commit 10ad8dc into calref:master Jul 28, 2024
6 checks passed
@NQNStudios NQNStudios mentioned this pull request Aug 7, 2024
@NQNStudios NQNStudios deleted the rebased branch September 8, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants