How to access another C++ class' ENUM? For animation purposes

I feel this is basic C++, and call me inexperienced anyways. Besides that, I’m trying to send over mainchar.cpp’s state enum, over to another class that looks for any changes of state, and have it mimics mainchar’s. I tried quite a bit of solutions and research to no avail. Here’s the code, last time I nuked someone, so I’ll show the important parts.

mainchar.cpp

basescythe.cpp

I might not know something, but isn’t AMainChar() is a constructor? Why do you use AMainChar() everywhere?

You need to get a reference to the actual character, and get the enum variable from it.

If you #include your character class, you’ll be able to use the enums declared in it; however, if you know that you’re going to use enums in multiple different classes, I suggest creating a separate class that will hold all enums that you need. Of course, you’ll have to #include it to every class in which you want to use those enums.

2 Likes