MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / OrderConditionCompare

Function OrderConditionCompare

src/order_cmd.cpp:1893–1906  ·  view source on GitHub ↗

* Compare the variable and value based on the given comparator. */

Source from the content-addressed store, hash-verified

1891 * Compare the variable and value based on the given comparator.
1892 */
1893static bool OrderConditionCompare(OrderConditionComparator occ, int variable, int value)
1894{
1895 switch (occ) {
1896 case OrderConditionComparator::Equal: return variable == value;
1897 case OrderConditionComparator::NotEqual: return variable != value;
1898 case OrderConditionComparator::LessThan: return variable < value;
1899 case OrderConditionComparator::LessThanOrEqual: return variable <= value;
1900 case OrderConditionComparator::MoreThan: return variable > value;
1901 case OrderConditionComparator::MoreThanOrEqual: return variable >= value;
1902 case OrderConditionComparator::IsTrue: return variable != 0;
1903 case OrderConditionComparator::IsFalse: return variable == 0;
1904 default: NOT_REACHED();
1905 }
1906}
1907
1908static bool OrderConditionCompare(OrderConditionComparator occ, ConvertibleThroughBase auto variable, int value)
1909{

Callers 1

ProcessConditionalOrderFunction · 0.85

Calls 2

NOT_REACHEDFunction · 0.85
baseMethod · 0.45

Tested by

no test coverage detected