by Sir Robin » Wed Nov 15, 2023 8:52 am
this is a pretty minor thing and easy to work around, but it would be nice if enums continued in subclasses
Code: Select all
class test : inventory
{
enum MyEnum
{
MY_First,
MY_Second
}
default {+inventory.invbar;inventory.icon "UNKNA0";}
states {spawn:UNKN A -1;stop;}
override bool use(bool pickup)
{
console.printf("first: "..MY_First);
console.printf("second: "..MY_Second);
return false;
}
}
class test1 : test
{
enum MyEnum
{
MY_Third,
MY_Fourth
}
override bool use(bool pickup)
{
super.use(pickup);
console.printf("third: "..MY_Third);
console.printf("fourth: "..MY_Fourth);
return false;
}
}
it would be nice if
test1.MY_Third==2 but it restarts at 0
this is a pretty minor thing and easy to work around, but it would be nice if enums continued in subclasses
[code]
class test : inventory
{
enum MyEnum
{
MY_First,
MY_Second
}
default {+inventory.invbar;inventory.icon "UNKNA0";}
states {spawn:UNKN A -1;stop;}
override bool use(bool pickup)
{
console.printf("first: "..MY_First);
console.printf("second: "..MY_Second);
return false;
}
}
class test1 : test
{
enum MyEnum
{
MY_Third,
MY_Fourth
}
override bool use(bool pickup)
{
super.use(pickup);
console.printf("third: "..MY_Third);
console.printf("fourth: "..MY_Fourth);
return false;
}
}
[/code]
it would be nice if [c]test1.MY_Third==2[/c] but it restarts at 0