--- a/src/ai/api/ai_cargo.hpp Mon Mar 19 00:19:42 2007 +0000
+++ b/src/ai/api/ai_cargo.hpp Mon Mar 19 10:08:18 2007 +0000
@@ -13,6 +13,13 @@
class AICargo : public AIObject {
public:
/**
+ * Checks whether the given cargo type is valid.
+ * @param cargo_type the cargo to check.
+ * @return true if and only if the cargo type is valid.
+ */
+ bool IsValidCargo(CargoID cargo_type);
+
+ /**
* Gets the string representation of the cargo label.
* @param cargo_type to get the string representation of.
* @return the cargo label.
@@ -43,6 +50,7 @@
DefSQClass <AICargo> SQAICargo("AICargo");
SQAICargo.PreRegister(engine);
SQAICargo.AddConstructor(engine);
+ SQAICargo.DefSQFunction(engine, &AICargo::IsValidCargo, "IsValidCargo");
SQAICargo.DefSQFunction(engine, &AICargo::GetCargoLabel, "GetCargoLabel");
SQAICargo.DefSQFunction(engine, &AICargo::IsFreight, "IsFreight");
SQAICargo.DefSQFunction(engine, &AICargo::GetCargoIncome, "GetCargoIncome");