-
Notifications
You must be signed in to change notification settings - Fork 45
Replacing IDs with IdType: Scene IDs #42
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
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| public static function parseXmlId(id: String): IdType { | ||
| return Std.parseInt(id); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parseXmlId is a little weird to me because it's not parsing from Fast or Xml, but String. Simple parseId might be better.
com/stencyl/behavior/Script.hx
Outdated
| * Get the ID of a scene by name. | ||
| * | ||
| * @return The ID current scene or 0 if it doesn't exist. | ||
| * @return The ID current scene or "" if it doesn't exist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't true yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this should be INVALID_ID
| scale = Std.parseInt(xml.att.scale); | ||
| defaultSceneID = 0; | ||
| defaultSceneID = IdUtils.INVALID_ID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not equivalent, but this shouldn't be an issue because if the defaultSceneID can't be read, something is really wrong anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's not, but 0 is also wrong, I guess?
If I create a game, add two scenes, then delete the first one 0 is not a valid scene either...
No description provided.