Convert entity types to an enum (#1007)

In an effort to remove magic numbers, I've given every entity type a
name. Hopefully I didn't miss anywhere.

Also, add `createentity` case 100 for backwards compatibility.

Co-authored-by: NyakoFox <nyakowofox@gmail.com>
Co-authored-by: Dav999 <dav999.tolp@gmail.com>
This commit is contained in:
Ally
2024-11-17 12:45:57 -04:00
committed by GitHub
parent 9c45dfb845
commit 63880169e6
7 changed files with 181 additions and 120 deletions
+30 -1
View File
@@ -5,6 +5,34 @@
#define rn( rx, ry) ((rx) + ((ry) * 100))
enum EntityType
{
EntityType_INVALID = -1,
EntityType_PLAYER,
EntityType_MOVING,
EntityType_DISAPPEARING_PLATFORM,
EntityType_QUICKSAND,
EntityType_GRAVITY_TOKEN,
EntityType_PARTICLE,
EntityType_COIN,
EntityType_TRINKET,
EntityType_CHECKPOINT,
EntityType_HORIZONTAL_GRAVITY_LINE,
EntityType_VERTICAL_GRAVITY_LINE,
EntityType_WARP_TOKEN,
EntityType_CREWMATE,
EntityType_TERMINAL,
EntityType_SUPERCREWMATE,
EntityType_TROPHY,
EntityType_GRAVITRON_ENEMY = 23,
EntityType_WARP_LINE_LEFT = 51,
EntityType_WARP_LINE_RIGHT = 52,
EntityType_WARP_LINE_TOP = 53,
EntityType_WARP_LINE_BOTTOM = 54,
EntityType_COLLECTABLE_CREWMATE = 55,
EntityType_TELEPORTER = 100
};
class entclass
{
public:
@@ -26,7 +54,8 @@ public:
public:
//Fundamentals
bool invis;
int type, size, tile, rule;
EntityType type;
int size, tile, rule;
int state, statedelay;
int behave, animate;
float para;