1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-26 14:38:30 +02:00
VVVVVV/desktop_version/src/UtilityClass.h
Misa 34e89bfcd3 Move endsWith() to UtilityClass.cpp and put it in header file
This ensures that endsWith() can be used outside of editor.cpp.

When leo60228 originally wrote endsWith(), it was static, but I asked
him on Discord just now and he more-or-less confirmed that it's fine if
it's not static. If it was static, it would be confined to
UtilityClass.cpp now instead!
2020-06-21 20:25:22 -04:00

54 lines
1.0 KiB
C++

#ifndef UTILITYCLASS_H
#define UTILITYCLASS_H
#include <SDL.h>
#include <vector>
#include <string>
int ss_toi(std::string _s);
std::vector<std::string> split(const std::string &s, char delim, std::vector<std::string> &elems);
std::vector<std::string> split(const std::string &s, char delim);
bool is_positive_num(const std::string& str, bool hex);
bool endsWith(const std::string& str, const std::string& suffix);
#define INBOUNDS(index, vector) ((int) index >= 0 && (int) index < (int) vector.size())
//helperClass
class UtilityClass
{
public:
UtilityClass();
static std::string String(int _v);
static std::string GCString(std::vector<SDL_GameControllerButton> buttons);
std::string twodigits(int t);
std::string timestring(int t);
std::string number(int _t);
static bool intersects( SDL_Rect A, SDL_Rect B );
void updateglow();
int glow;
int slowsine;
int glowdir;
int globaltemp;
int temp;
int temp2;
std::vector<int> splitseconds;
};
extern UtilityClass help;
#endif /* UTILITYCLASS_H */