You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
Currently constants are surfaced as enumerations, but some high-level languages like C# and Swift offer special capabilities for values that should be treated as flags, both during debugging and at the language level.
For instance:
[Flags]
enum ValidColor {
Red = 1 << 0,
Blue = 1 << 1,
Green = 1 << 2
}
var myValid = ValidColor.Red | ValidColor.Blue
The Flags attribute in C# turns the debugging capability that would print "Red, Blue" as opposed as printing the value "3". In Swift this surfaces a different API that allows users to use set-like operations in the language
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add method hints to ClassDB to signal that would allow developers to flag constants in a group as being flags - that is, that they can be combined, as opposed to being alternatives or states.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
ClassDB::bind_integer_constant would take an additional parameter that would flag the enumeration as being part of flags. If any of the flags listed has this flag set, the entire enumeration is considered a flags enumeration. A new macro BIND_ENUM_CONSTANT_FLAG, peer of BIND_ENUM_CONSTANT could simplify that process.
If this enhancement will not be used often, can it be worked around with a few lines of script?
It is purely a matter of surfacing better language and debugging capabilities.
Is there a reason why this should be core and not an add-on in the asset library?
It has to be on the core method database.
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
C# and Swift bindings
Describe the problem or limitation you are having in your project
Currently constants are surfaced as enumerations, but some high-level languages like C# and Swift offer special capabilities for values that should be treated as flags, both during debugging and at the language level.
For instance:
The
Flags
attribute in C# turns the debugging capability that would print "Red, Blue" as opposed as printing the value "3". In Swift this surfaces a different API that allows users to use set-like operations in the languageDescribe the feature / enhancement and how it helps to overcome the problem or limitation
Add method hints to ClassDB to signal that would allow developers to flag constants in a group as being flags - that is, that they can be combined, as opposed to being alternatives or states.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
ClassDB::bind_integer_constant
would take an additional parameter that would flag the enumeration as being part of flags. If any of the flags listed has this flag set, the entire enumeration is considered a flags enumeration. A new macroBIND_ENUM_CONSTANT_FLAG
, peer ofBIND_ENUM_CONSTANT
could simplify that process.If this enhancement will not be used often, can it be worked around with a few lines of script?
It is purely a matter of surfacing better language and debugging capabilities.
Is there a reason why this should be core and not an add-on in the asset library?
It has to be on the core method database.
The text was updated successfully, but these errors were encountered: