GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add `FlxGroup#killAll()` and `FlxGroup#reviveAll()` by IQAndreas · Pull Request #185 · FlixelCommunity/flixel

Conversation

@IQAndreas

@IQAndreas IQAndreas commented Oct 22, 2013

Copy link
Copy Markdown
Member

See #30 (comment)

I also added a second commit which points out this new behavior of FlxGroup#kill() and just emphasizes the original behavior of FlxGroup#revive(). Since we are no longer overriding those methods, adding the relevant ASDoc inside FlxGroup would be possible, but seems more complicated than we need to make it. It's easier just to add the information to FlxBasic instead.

Should I keep the second commit, or remove it?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@IQAndreas
Add FlxGroup#killAll() and FlxGroup#reviveAll()
0ac4893
`FlxGroup#kill()` and `FlxGroup#revive()` no longer kill or revive the
group's members, only the group itself.

See
FlixelCommunity#30 (comment)
@IQAndreas IQAndreas mentioned this pull request Oct 22, 2013
FlxGroup.kill() and Flxgroup.revive() #30
Open
@IQAndreas
Update the ASDoc in FlxBasic to point out the kill and revive b…
4453edf
…ehaviors of `FlxGroup`

... since we are no longer overriding those methods, adding the relevant
ASDoc would be possible, but seems less logical than it needs to be.
It's easier just to add the information to `FlxBasic` instead.
@Dovyski

Dovyski commented Oct 24, 2013

Copy link
Copy Markdown
Member

First a question: now that we have killAll() and reviveAll(), shouldn't FlxGroup#kill() just kill itself instead of all its members?

About the code, even though it looks great, I think we could implement it using already existing methods, such as callAll(). It makes sense to me since killAll() is some sort of alias for callAll("kill") after all. The same goes for reviveAll().

About the ASDoc, I think it is misplaced. The text should not be placed in FlxBasic, but in FlxGroup instead. If I want to know how FlxGroup#kill() works, I will check the docs for that method, not it's equivalent in the super class.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@IQAndreas

IQAndreas commented Oct 24, 2013

Copy link
Copy Markdown
Member Author

Now that we have killAll() and eviveAll(), shouldn't FlxGroup#kill() just kill itself instead of all its members?

Yep, that's the way I set it up in the code (the diff looks a bit funny, but you can see the final result here).

The text should not be placed in FlxBasic, but in FlxGroup instead. If I want to know how FlxGroup#kill() works, I will check the docs for that method, not it's equivalent in the super class.

I agree, but the problem is, FlxGroup no longer has it's own kill or revive methods, since it is no longer overriding the FlxBasic methods, so adding the documentation may prove a hassle. After some thinking (though I haven't tested it yet), may be possible to do something like this:

/** Documentation here... */
override public function kill():void
{
    super.kill();
}

The reason I added it to FlxBasic: I figured since FlxBasic already mentions FlxGroup in a few cases, it's maybe not the end of the world if the FlxGroup behaviour is placed where it is.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@IQAndreas

IQAndreas commented Oct 24, 2013

Copy link
Copy Markdown
Member Author

I think we could implement it using already existing methods, such as callAll(). It makes sense to me since killAll() is some sort of alias for callAll("kill") after all. The same goes for reviveAll().

To be honest, although handy, I hate methods like that; it reeks of too much "dynamicness". I figured every member is going to at least be a FlxBasic object which is guaranteed to have the kill() and revive() methods. When possible, I personally prefer being "stricter" about it by calling the methods directly.

It is also much faster, though in this scenario, I don't see performance as being an issue as killAll() and reviveAll() would be called so seldom.

Although it does use up more code than is necessary, so I am alright with changing it to callAll("kill") if you prefer.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Dovyski

Dovyski commented Oct 25, 2013

Copy link
Copy Markdown
Member

I'm sorry about the kill() change, I probably overlooked while inspecting the code. As using callAll(), I agree with you about "dynamicness" and I don't like them too. Let's stick with the current implementation of killAll() and reviveAll().

About the docs, I'm not sure how to proceed. I think something like this...

/** Documentation here... */
override public function kill():void
{
    super.kill();
}

...is ugly, but necessary. IDEs showing docs during auto-complete, for instance, will help developers to understand what is happening. However, as you said, it's not the end of the world with the docs are in FlxBasic, I'm ok with that :)

And about pushing this change up to the next release, any thoughts on that?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@IQAndreas IQAndreas mentioned this pull request Oct 26, 2013
Revert "Add FlxGroup::revive()" #187
Merged
@IQAndreas

IQAndreas commented Oct 26, 2013

Copy link
Copy Markdown
Member Author

And about pushing this change up to the next release, any thoughts on that?

Yeah, that's probably a good idea. I went ahead and added a pull request which reverts the changes to revive() as well: #187

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Dovyski

Dovyski commented Oct 26, 2013

Copy link
Copy Markdown
Member

Great! This pull request will remain open and attached to #30, which has been pushed up to the next release. During the next cycle we check and merge this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Dovyski pushed a commit to Dovyski/flixel that referenced this pull request Nov 15, 2013
@IQAndreas
Revert "Add FlxGroup::revive()"
0d5953f
The following commit has been undone:
FlixelCommunity#110

And a tiny bit of documentation has been added describing the changes.

Discussion:
 - FlixelCommunity#185
 -
FlixelCommunity#30 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

new feature pull request wait until next version

Projects

None yet

Milestone

Future release

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@IQAndreas @Dovyski
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.