-
Notifications
You must be signed in to change notification settings - Fork 0
/
cleanHackCLS.cpp
49 lines (49 loc) · 1.04 KB
/
cleanHackCLS.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "cleanCLS.h"
HACK::HACK( void ) { Clear(); }
HACK::~HACK( void ) { Clear(); }
CODE& HACK::operator[] ( s32 index )
{
if ( index < 0 || index >= GetCount() )
throw std::out_of_range( "Hack tried to access Code outside of range" );
return p_data[ index ];
}
CODE& HACK::operator[] ( u32 index )
{
if ( index >= ( u8 )GetCount() )
throw std::out_of_range( "Hack tried to access Code outside of range" );
return p_data[ index ];
}
void HACK::Clear( void )
{
id = 0u;
use = false;
useRB = false;
p_data.clear();
}
void HACK::SetCount( s8 count )
{
if ( count < 0 ) count = 0;
if ( count > 100 ) count = 100;
p_data.resize( count );
}
s8 HACK::GetCount( void )
{
s8 count = p_data.size();
return count;
}
s8 HACK::NewCode( CODE code )
{
s8 index = -1;
s8 count = GetCount();
if ( count < 100 )
{
p_data.push_back( code );
index = count;
}
return index;
}
void HACK::DelCode( s8 index )
{
if ( index >= 0 && index < GetCount() )
p_data.erase( p_data.begin() + index );
}