summaryrefslogtreecommitdiff
path: root/src/order_type.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-12 11:58:19 +0000
committerrubidium <rubidium@openttd.org>2008-04-12 11:58:19 +0000
commitac94b6384b518390c7e7791446c06c78cb6ce1d2 (patch)
treea1bb66a0b0fdffbcfd3789f35b269fc5940731ca /src/order_type.h
parent04b9600920808bcb6195f649c58f905983af9a9b (diff)
downloadopenttd-ac94b6384b518390c7e7791446c06c78cb6ce1d2.tar.xz
(svn r12667) -Feature: conditional 'skip/jump' orders.
Diffstat (limited to 'src/order_type.h')
-rw-r--r--src/order_type.h41
1 files changed, 37 insertions, 4 deletions
diff --git a/src/order_type.h b/src/order_type.h
index a6273e684..33de1bd83 100644
--- a/src/order_type.h
+++ b/src/order_type.h
@@ -27,6 +27,7 @@ enum OrderType {
OT_LEAVESTATION = 4,
OT_DUMMY = 5,
OT_GOTO_WAYPOINT = 6,
+ OT_CONDITIONAL = 7,
OT_END
};
@@ -86,13 +87,45 @@ enum OrderDepotActionFlags {
};
/**
+ * Variables (of a vehicle) to 'cause' skipping on.
+ */
+enum OrderConditionVariable {
+ OCV_LOAD_PERCENTAGE, ///< Skip based on the amount of load
+ OCV_RELIABILITY, ///< Skip based on the reliability
+ OCV_MAX_SPEED, ///< Skip based on the maximum speed
+ OCV_AGE, ///< Skip based on the age
+ OCV_REQUIRES_SERVICE, ///< Skip when the vehicle requires service
+ OCV_END
+};
+
+/**
+ * Comparator for the skip reasoning.
+ */
+enum OrderConditionComparator {
+ OCC_EQUALS, ///< Skip if both values are equal
+ OCC_NOT_EQUALS, ///< Skip if both values are not equal
+ OCC_LESS_THAN, ///< Skip if the value is less than the limit
+ OCC_LESS_EQUALS, ///< Skip if the value is less or equal to the limit
+ OCC_MORE_THAN, ///< Skip if the value is more than the limit
+ OCC_MORE_EQUALS, ///< Skip if the value is more or equal to the limit
+ OCC_IS_TRUE, ///< Skip if the variable is true
+ OCC_IS_FALSE, ///< Skip if the variable is false
+ OCC_END
+};
+
+
+/**
* Enumeration for the data to set in CmdModifyOrder.
*/
enum ModifyOrderFlags {
- MOF_NON_STOP, ///< Passes a OrderNonStopFlags.
- MOF_UNLOAD, ///< Passes an OrderUnloadType.
- MOF_LOAD, ///< Passes an OrderLoadType
- MOF_DEPOT_ACTION, ///< Toggle the 'service' if needed flag.
+ MOF_NON_STOP, ///< Passes a OrderNonStopFlags.
+ MOF_UNLOAD, ///< Passes an OrderUnloadType.
+ MOF_LOAD, ///< Passes an OrderLoadType
+ MOF_DEPOT_ACTION, ///< Toggle the 'service' if needed flag.
+ MOF_COND_VARIABLE, ///< A conditional variable changes.
+ MOF_COND_COMPARATOR, ///< A comparator changes.
+ MOF_COND_VALUE, ///< The value to set the condition to.
+ MOF_END
};