77 lines
2.2 KiB
C++
77 lines
2.2 KiB
C++
/*
|
|
* =====================================================================================
|
|
*
|
|
* Filename: EntityConverter.hpp
|
|
*
|
|
* Description: Convert reflex entities to xonotic entities
|
|
*
|
|
* Version: 1.0
|
|
* Created: 05/27/2017 08:21:14 AM
|
|
* Revision: none
|
|
* Compiler: gcc
|
|
*
|
|
* Author: suhrke@teknik.io
|
|
*
|
|
* =====================================================================================
|
|
*/
|
|
|
|
#ifndef ENTITY_CONVERTER_HPP
|
|
#define ENTITY_CONVERTER_HPP
|
|
|
|
// Reflex Format
|
|
// -"Pickup" denoted by ID
|
|
// conventional item and weapon conversion stored in r2x.ent
|
|
// -"PlayerSpawn" consists of coordinate (Vector3),
|
|
// angle (first element of Vector3),
|
|
// team indicator (on individual lines),
|
|
// game type indicator (on individual lines)
|
|
// -"JumpPad" stored as a brush and a Target
|
|
// -"Teleporter" stored as a brush and a Target
|
|
// -"Target" stored as a position (Vector3) and
|
|
// "name" (String32)
|
|
// ***Target can be destination of teleports OR jump pads
|
|
// -MORE TO BE ADDED (Effect, liquids etc)
|
|
|
|
// Xonotic Format
|
|
// -pickups prefixed by either "item_" or "weapon_"
|
|
// -spawns stored as separate entity types
|
|
// "info_player_deathmatch"
|
|
// "info_player_team1"
|
|
// "info_player_team2"
|
|
// "info_player_team3"
|
|
// "info_player_team4"
|
|
// where each consists of a coordinate "origin" (vector3)
|
|
// an angle "angle" (a single number)
|
|
// -jump pads stored as "classname" "target_push",
|
|
// a coordinate "origin" (vector3),
|
|
// a target "targetname"
|
|
// OR stored as "classname" "trigger_push",
|
|
// a target "target",
|
|
// a brush
|
|
// -teleports stored as "classname" "trigger_teleport"
|
|
// a target "target",
|
|
// a brush
|
|
// -teleport destinations stored as "classname" "misc_teleporter_dest",
|
|
// a coordinate "origin" (vector3),
|
|
// an angle "angle" (a single number),
|
|
// a target "targetname"
|
|
|
|
#include <map>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class EntityConverter
|
|
{
|
|
public:
|
|
EntityConverter(std::string entityMapFile);
|
|
std::vector<std::string> convert(std::vector<std::string> lines);
|
|
void printMapping(); //DEBUG
|
|
protected:
|
|
private:
|
|
std::string getAttributeType(std::string line);
|
|
std::map<int, std::string> pickupMapping;
|
|
};
|
|
|
|
#endif //ENTITY_CONVERTER_HPP
|
|
|