forked from Bloodmallet/simc_support
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimc_checks.py
More file actions
137 lines (119 loc) · 2.9 KB
/
Copy pathsimc_checks.py
File metadata and controls
137 lines (119 loc) · 2.9 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# -*- coding: utf-8 -*-
## Lib to check simc_options input values
##
## @brief Gets all fight styles.
##
## @return The fight styles.
##
def get_fight_styles():
return (
"patchwerk",
"lightmovement",
"heavymovement",
"hecticaddcleave",
"beastlord",
"helterskelter"
)
##
## @brief Gets the profiles of the current addon.
##
## @return The profiles.
##
def get_profiles():
return (
"T19P",
"T19H",
"T19H_NH",
"T19M",
"T19M_NH",
"T20H",
"T20M"
)
##
## @brief Gets the tiers for the current addon
##
## @return The tiers.
##
def get_tiers():
return (
"19",
"20"
)
##
## @brief Validates the input fight style.
##
## @param fight_styles The fight style like in SimC options
##
## @return True if fight_style matches predetermined SimC-styles
##
def is_fight_style(fight_styles):
fight_style_list = get_fight_styles()
for fight_style in fight_styles:
if not type(fight_style) is str:
return False
if not fight_style.lower() in fight_style_list:
return False
return True
##
## @brief Determines if iteration is a number as a string and greater than
## 5000.
##
## @param iterations The iterations
##
## @return True if iterations is string and greater than 5000, False
## otherwise.
##
def is_iteration(iterations):
if type(iterations) is str:
if int(iterations) >= 5000:
return True
return False
##
## @brief Determines if profile is a valid input based on simc profiles.
##
## @param profile The profile
##
## @return True if profile matches simc profiles, False otherwise.
##
def is_profile(profile):
for base_profile in get_profiles():
if profile.lower() == base_profile.lower():
return True
return False
##
## @brief Determines if target error is string and < 0.5 and >= 0.0.
##
## @param target_error The target error
##
## @return True if target error is string and < 0.5 and >= 0.0, False
## otherwise.
##
def is_target_error(target_error):
if type(target_error) is str:
if 0.5 >= float(target_error) >= 0.0:
return True
return False
##
## @brief Determines if threads is useable for simc.
##
## @param threads The threads
##
## @return True if threads, False otherwise.
##
def is_threads(threads):
if type(threads) == str:
if threads == "" or int(threads) > 0:
return True
return False
##
## @brief Determines if tier number matches the current (addon) available tiers.
##
## @param tier_number The tier number
##
## @return True if tier number, False otherwise.
##
def is_tier_number(tier_number):
if type(tier_number) == str:
if tier_number in get_tiers():
return True
return False