summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaFunctions.h
blob: 98341a131a99efb832eabc860a1190fb9ea6ff7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once

#include "Logger.h"
#include <time.h>
#include <chrono>
// tolua_begin

inline unsigned int GetTime()
{
	// NB: For caveats, please see https://stackoverflow.com/a/14505248
	return static_cast<unsigned int>(std::chrono::seconds(time(0)).count());
}

inline std::string GetChar( std::string & a_Str, unsigned int a_Idx)
{
	return std::string(1, a_Str[ a_Idx ]);
}

// tolua_end