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

Add TagSet and editor support (#129) #132

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

evrimoztamur
Copy link
Contributor

This PR adds support through the use of a HashSet sub-class, which gets some editor features.

@evrimoztamur
Copy link
Contributor Author

Potential improvements, let's discuss:

  1. Ordering tags
  2. Better tag UI in editor
  3. Defining tag-specific behaviour in data files or in editor

@@ -0,0 +1,10 @@
package com.badlogic.gdx.utils;

import java.util.HashSet;
Copy link
Owner

Choose a reason for hiding this comment

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

Be warned, the default Java collections are not always great for performance since they sometimes create extra objects when accessed. LibGdx includes some more game-friendly collections, could this be done with something like the libGdx ArrayMap? https://libgdx.badlogicgames.com/ci/nightlies/docs/api/com/badlogic/gdx/utils/ArrayMap.html

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 opted in for the ObjectSet mainly because of the API compatibility, and also because the Set (as opposed to the Map) interface stores only a set of unique keys. There is no use for the values in the tag system.

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks! That looks nicer.

@joshuaskelly joshuaskelly marked this pull request as draft November 3, 2020 17:37
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