-
Notifications
You must be signed in to change notification settings - Fork 42
/
resolver_sets.h
86 lines (72 loc) · 1.14 KB
/
resolver_sets.h
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#pragma once
#include <string>
#include <vector>
#include <deque>
enum resolver_steps_t
{
STEP_FORCED_LAST_MOVING,
STEP_LAST_MOVING,
STEP_LBY,
STEP_FREESTAND,
STEP_UP,
STEP_NETWORKED,
STEP_MAXSTEP
};
struct resolver_set_t
{
std::vector<resolver_steps_t> steps;
int has_step( resolver_steps_t step )
{
for ( size_t i = 0; i < steps.size( ); i++ )
{
if ( steps.at( i ) == step )
return i;
}
return -1;
}
int increment( int shots ) const
{
return ( shots + 1 ) % steps.size( );
}
int wrap( int shots ) const
{
return ( shots ) % steps.size( );
}
resolver_steps_t get_step( int shots )
{
shots = wrap( shots );
return steps.at( shots );
}
};
static resolver_set_t spread_set =
{
{
STEP_FORCED_LAST_MOVING,
STEP_LBY,
STEP_FREESTAND,
}
};
static resolver_set_t nospread_set =
{
{
STEP_FORCED_LAST_MOVING,
STEP_LBY,
STEP_FREESTAND,
STEP_UP,
}
};
static resolver_set_t networked_set
{
{
STEP_NETWORKED,
}
};
static resolver_set_t* get_current_set( )
{
int autism_level = 0;
if ( autism_level == 0 )
return &spread_set;
if ( autism_level == 88 )
return &nospread_set;
return &networked_set;
}