Skip to content

Conversation

@AustinHellerRepo
Copy link
Contributor

All elements that act as a spawner (except for the fish school since the spawner acts as the parent element holding the inner fish elements) now have a Spawner component that will be discovered during the "delete element" process.
I also updated the ElementKillCallback ulid string since I just created it manually in the previous ticket and only recently learned of a way to generate a true random ulid string.
We should consider refactoring the fish school spawner to properly behave like a spawner containing entities.

@zicklag
Copy link
Member

zicklag commented May 13, 2023

Yeah, I'm thinking maybe we don't need the ElementKillCallback, maybe, if we have the Spawner abstraction.

The fish school could easily replace it's vector of fish with the entities from the spawner with no negative side-effects, and then we'd no longer have anything using the ElementKillCallback, so maybe it'd be better just to get rid of it.

What do you think?

@AustinHellerRepo
Copy link
Contributor Author

Yeah, I'm thinking maybe we don't need the ElementKillCallback, maybe, if we have the Spawner abstraction.

The fish school could easily replace it's vector of fish with the entities from the spawner with no negative side-effects, and then we'd no longer have anything using the ElementKillCallback, so maybe it'd be better just to get rid of it.

What do you think?

I completely agree. It's a nice custom feature to have, but if nothing is using it then we're just going to end up maintaining this feature through future maintenance and functionality, maybe even having to put in workarounds, just for this unused feature to exist. I'll refactor this branch to include the fish school's fish and then remove the ElementKillCallback. Thoughts?

@zicklag
Copy link
Member

zicklag commented May 14, 2023

Sounds like a plan!

…sh school logic to use the new Spawner component to handle killing the fish;
Copy link
Member

@zicklag zicklag left a comment

Choose a reason for hiding this comment

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

Looks good to me, is this ready?

@AustinHellerRepo
Copy link
Contributor Author

AustinHellerRepo commented May 14, 2023

Yeah, this is good for now. The rendered players still don't get removed yet, but that's something that might be a little bigger and different from this PR. I'll tackle that one next.
I'm thinking that each time a player spawner is removed I'll want to check to see that, if this is the last player spawner, to only then remove the spawned players.

@zicklag zicklag added this pull request to the merge queue May 14, 2023
Merged via the queue into fishfolk:main with commit aad4856 May 14, 2023
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