mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-09-30 02:07:23 +02:00
e6f3dab2e1
This makes it so that whenever a string is passed into these functions, it's no longer needlessly copied.
73 lines
1.2 KiB
C++
73 lines
1.2 KiB
C++
#ifndef SCRIPT_H
|
|
#define SCRIPT_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "Enums.h"
|
|
|
|
#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 */
|