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

Commenting the main flows #156

Merged
merged 3 commits into from
Dec 22, 2024
Merged

Commenting the main flows #156

merged 3 commits into from
Dec 22, 2024

Conversation

twof
Copy link
Contributor

@twof twof commented Dec 12, 2024

I want to do a little work on the project, but I wanted to understand how it functioned first. I studied the main flows (compilation, running the simulation), and left some descriptive comments along the way.

There are a couple of very small code changes that I'll mark, but I can revert them if you'd like.

Would it be helpful to have a writeup about the game's architecture in the wiki? I'd be down to throw one together while it's on my mind.

Comment on lines -95 to -103
let team = {
let data = data_mut(sim, handle);
data.ttl -= dt as f32;
if data.ttl <= 0.0 {
destroy(sim, handle);
continue;
}
data.team
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was having a little trouble parsing this when I was looking at it. It was unclear to me why mutations were being done inside the constructor for the team variable, so I restructured the code to make it a little easier to read.

Comment on lines -937 to -941
let ship_data = self
.simulation
.ship_data
.get_mut(self.handle.index())
.unwrap();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this line was the same as data_mut, so I replaced it with data_mut

@rlane rlane merged commit d0900f8 into rlane:master Dec 22, 2024
2 checks passed
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