spoonedit/Tools/MapTools/include/LevelObject.h

86 lines
1.9 KiB
C
Raw Normal View History

2023-07-02 22:21:26 +02:00
//
// Created by tv on 30.04.23.
//
#ifndef SPOONTOOL_LEVELOBJECT_H
#define SPOONTOOL_LEVELOBJECT_H
#include<Transform.h>
#include<Link.h>
#include<yaml-cpp/yaml.h>
#include "SpecialObjectParams.h"
#include "Element.h"
namespace Teams{
constexpr long Player = 0;
constexpr long Enemy = 1;
constexpr long Neutral = 2;
2023-07-02 22:21:26 +02:00
2023-11-12 16:29:22 +01:00
inline long flipTeam(long team){
2023-07-02 22:21:26 +02:00
switch(team){
2023-11-12 16:29:22 +01:00
case Player:
return Enemy;
case Enemy:
return Player;
2023-07-02 22:21:26 +02:00
default:
2023-11-12 16:29:22 +01:00
return team;
2023-07-02 22:21:26 +02:00
}
}
}
namespace DropId{
constexpr long Default = -1;
constexpr long Armor = 8;
constexpr long Map = 9;
constexpr long Key = 10;
constexpr long OneSphere = 11;
constexpr long FiveSphere = 12;
constexpr long TenSphere = 13;
constexpr long Bubbler = 14;
constexpr long Bazooka = 15;
constexpr std::array<long,9> AllOptions = {Default,Armor,Map,Key,OneSphere,FiveSphere,TenSphere,Bubbler,Bazooka};
inline constexpr std::string DropIdToText(long team) {
switch(team){
case -1:
return "Default";
case 8:
return "Armor";
case 9:
return "Map";
case 10:
return "Key";
case 11:
return "1 Sphere";
case 12:
return "5 Spheres";
case 13:
return "10 Spheres";
case 14:
return "Bubbler";
case 15:
return "Bazooka";
default:
return "Invalid";
}
}
}
struct LevelObject: public Element{
LevelObject(const YAML::Node &ObjNode);
protected:
2023-11-12 16:29:22 +01:00
void YamlInsertBody(YAML::Emitter &Emitter,bool compiled = false) override;
2023-07-02 22:21:26 +02:00
public:
long Team;
long DropId;
2023-11-12 16:29:22 +01:00
bool m_isStatic;
2023-07-02 22:21:26 +02:00
~LevelObject() = default;
};
#endif //SPOONTOOL_LEVELOBJECT_H