- RookContactCheckBonus = get_option_value_int("Rook Contact Check Bonus");
- QueenCheckBonus = get_option_value_int("Queen Check Bonus");
- RookCheckBonus = get_option_value_int("Rook Check Bonus");
- BishopCheckBonus = get_option_value_int("Bishop Check Bonus");
- KnightCheckBonus = get_option_value_int("Knight Check Bonus");
- DiscoveredCheckBonus = get_option_value_int("Discovered Check Bonus");
- MateThreatBonus = get_option_value_int("Mate Threat Bonus");
-
- a = get_option_value_int("King Safety Coefficient") / 100.0;
- b = get_option_value_int("King Safety X Intercept") * 1.0;
- maxSlope = get_option_value_int("King Safety Max Slope");
- peak = (get_option_value_int("King Safety Max Value") * 256) / 100;
-
- for(i = 0; i < 100; i++) {
- if(i < b) SafetyTable[i] = Value(0);
- else if(get_option_value_string("King Safety Curve") == "Quadratic")
- SafetyTable[i] = Value((int)(a * (i - b) * (i - b)));
- else if(get_option_value_string("King Safety Curve") == "Linear")
- SafetyTable[i] = Value((int)(100 * a * (i - b)));
+ RookContactCheckBonus = get_option_value_int("Rook Contact Check Bonus");
+ QueenCheckBonus = get_option_value_int("Queen Check Bonus");
+ RookCheckBonus = get_option_value_int("Rook Check Bonus");
+ BishopCheckBonus = get_option_value_int("Bishop Check Bonus");
+ KnightCheckBonus = get_option_value_int("Knight Check Bonus");
+ DiscoveredCheckBonus = get_option_value_int("Discovered Check Bonus");
+ MateThreatBonus = get_option_value_int("Mate Threat Bonus");
+
+ int maxSlope = get_option_value_int("King Safety Max Slope");
+ int peak = get_option_value_int("King Safety Max Value") * 256 / 100;
+ double a = get_option_value_int("King Safety Coefficient") / 100.0;
+ double b = get_option_value_int("King Safety X Intercept");
+ bool quad = (get_option_value_string("King Safety Curve") == "Quadratic");
+ bool linear = (get_option_value_string("King Safety Curve") == "Linear");
+
+ for (int i = 0; i < 100; i++)
+ {
+ if (i < b)
+ SafetyTable[i] = Value(0);
+ else if(quad)
+ SafetyTable[i] = Value((int)(a * (i - b) * (i - b)));
+ else if(linear)
+ SafetyTable[i] = Value((int)(100 * a * (i - b)));