Enums or constants in AngelScript
up vote
0
down vote
favorite
In other programming languages I can use static class methods or enums to encapsulate constants:
enum Command {
command_1 = "0x00001",
command_2 = "0x00002",
command_2 = "0x00003"
}
or
class Command {
static command_1 = "0x00001"
static command_2 = "0x00002"
static command_3 = "0x00003"
}
How is this solved in AngelScript? As far as I know there are neither enums (with non-integer values) nor static class methods.
angelscript
add a comment |
up vote
0
down vote
favorite
In other programming languages I can use static class methods or enums to encapsulate constants:
enum Command {
command_1 = "0x00001",
command_2 = "0x00002",
command_2 = "0x00003"
}
or
class Command {
static command_1 = "0x00001"
static command_2 = "0x00002"
static command_3 = "0x00003"
}
How is this solved in AngelScript? As far as I know there are neither enums (with non-integer values) nor static class methods.
angelscript
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
In other programming languages I can use static class methods or enums to encapsulate constants:
enum Command {
command_1 = "0x00001",
command_2 = "0x00002",
command_2 = "0x00003"
}
or
class Command {
static command_1 = "0x00001"
static command_2 = "0x00002"
static command_3 = "0x00003"
}
How is this solved in AngelScript? As far as I know there are neither enums (with non-integer values) nor static class methods.
angelscript
In other programming languages I can use static class methods or enums to encapsulate constants:
enum Command {
command_1 = "0x00001",
command_2 = "0x00002",
command_2 = "0x00003"
}
or
class Command {
static command_1 = "0x00001"
static command_2 = "0x00002"
static command_3 = "0x00003"
}
How is this solved in AngelScript? As far as I know there are neither enums (with non-integer values) nor static class methods.
angelscript
angelscript
asked Nov 9 at 16:12
Michael Dorner
6,40194166
6,40194166
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
You can use namespace:
namespace consts_values
{
const string a = "aaa";
const string b = "bbb";
}
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
You can use namespace:
namespace consts_values
{
const string a = "aaa";
const string b = "bbb";
}
add a comment |
up vote
1
down vote
You can use namespace:
namespace consts_values
{
const string a = "aaa";
const string b = "bbb";
}
add a comment |
up vote
1
down vote
up vote
1
down vote
You can use namespace:
namespace consts_values
{
const string a = "aaa";
const string b = "bbb";
}
You can use namespace:
namespace consts_values
{
const string a = "aaa";
const string b = "bbb";
}
answered 11 hours ago
arie
116
116
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53229400%2fenums-or-constants-in-angelscript%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown