1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-24 13:38:29 +02:00
VVVVVV/desktop_version/src/Script.h
Misa b5ff65c84e Remove unnecessary includes from header files
Including a header file inside another header file means a bunch of
files are going to be unnecessarily recompiled whenever that inner
header file is changed. So I minimized the amount of header files
included in a header file, and only included the ones that were
necessary (system includes don't count, I'm only talking about includes
from within this project). Then the includes are only in the .cpp files
themselves.

This also minimizes problems such as a NO_CUSTOM_LEVELS build failing
because some file depended on an include that got included in editor.h,
which is another benefit of removing unnecessary includes from header
files.
2020-07-19 21:37:40 -04:00

72 lines
1.1 KiB
C++

#ifndef SCRIPT_H
#define SCRIPT_H
#include <string>
#include <vector>
#define filllines(lines) commands.insert(commands.end(), lines, lines + sizeof(lines)/sizeof(lines[0]))
struct Script
{
std::string name;
std::vector<std::string> contents;
};
class scriptclass
{
public:
scriptclass();
void load(const std::string& name);
void loadother(const char* t);
void loadcustom(const std::string& t);
void inline add(const std::string& t)
{
commands.push_back(t);
}
void clearcustom();
void tokenize(const std::string& t);
void run();
void resetgametomenu();
void startgamemode(int t);
void teleport();
void hardreset();
//Script contents
std::vector<std::string> commands;
std::string words[40];
std::vector<std::string> txt;
std::string scriptname;
int position;
int looppoint, loopcount;
int scriptdelay;
bool running, dontrunnextframe;
//Textbox stuff
int textx;
int texty;
int r,g,b;
//Misc
int i, j, k;
//Custom level stuff
std::vector<Script> customscripts;
};
extern scriptclass script;
#endif /* SCRIPT_H */