summaryrefslogtreecommitdiff
path: root/src/script/api/script_company.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/script_company.hpp')
-rw-r--r--src/script/api/script_company.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/script/api/script_company.hpp b/src/script/api/script_company.hpp
index e6c3dcb31..349961961 100644
--- a/src/script/api/script_company.hpp
+++ b/src/script/api/script_company.hpp
@@ -13,6 +13,7 @@
#define SCRIPT_COMPANY_HPP
#include "script_text.hpp"
+#include "../../economy_type.h"
/**
* Class that handles all company related functions.
@@ -45,6 +46,27 @@ public:
};
/**
+ * Types of expenses.
+ * @api -ai
+ */
+ enum ExpensesType {
+ EXPENSES_CONSTRUCTION = ::EXPENSES_CONSTRUCTION, ///< Construction costs.
+ EXPENSES_NEW_VEHICLES = ::EXPENSES_NEW_VEHICLES, ///< New vehicles.
+ EXPENSES_TRAIN_RUN = ::EXPENSES_TRAIN_RUN, ///< Running costs trains.
+ EXPENSES_ROADVEH_RUN = ::EXPENSES_ROADVEH_RUN, ///< Running costs road vehicles.
+ EXPENSES_AIRCRAFT_RUN = ::EXPENSES_AIRCRAFT_RUN, ///< Running costs aircrafts.
+ EXPENSES_SHIP_RUN = ::EXPENSES_SHIP_RUN, ///< Running costs ships.
+ EXPENSES_PROPERTY = ::EXPENSES_PROPERTY, ///< Property costs.
+ EXPENSES_TRAIN_INC = ::EXPENSES_TRAIN_INC, ///< Income from trains.
+ EXPENSES_ROADVEH_INC = ::EXPENSES_ROADVEH_INC, ///< Income from road vehicles.
+ EXPENSES_AIRCRAFT_INC = ::EXPENSES_AIRCRAFT_INC, ///< Income from aircrafts.
+ EXPENSES_SHIP_INC = ::EXPENSES_SHIP_INC, ///< Income from ships.
+ EXPENSES_LOAN_INT = ::EXPENSES_LOAN_INT, ///< Interest payments over the loan.
+ EXPENSES_OTHER = ::EXPENSES_OTHER, ///< Other expenses.
+ INVALID_EXPENSES = ::INVALID_EXPENSES, ///< Invalid expense type.
+ };
+
+ /**
* Resolved the given company index to the correct index for the company. If
* the company index was COMPANY_SELF it will be resolved to the index of
* your company. If the company with the given index does not exist it will
@@ -165,6 +187,19 @@ public:
static Money GetBankBalance(CompanyID company);
/**
+ * Changes the bank balance by a delta value. This method does not affect the loan but instead
+ * allows a GS to give or take money from a company.
+ * @param company The company to change the bank balance of.
+ * @param delta Amount of money to give or take from the bank balance. A positive value adds money to the bank balance.
+ * @param expenses_type The account in the finances window that will register the cost.
+ * @game @pre No ScriptCompanyMode active in scope.
+ * @pre ResolveCompanyID(company) != COMPANY_INVALID.
+ * @note You need to create your own news message to inform about costs/gifts that you create using this command.
+ * @api -ai
+ */
+ static bool ChangeBankBalance(CompanyID company, int32 delta, ExpensesType expenses_type);
+
+ /**
* Get the income of the company in the given quarter.
* Note that this function only considers recurring income from vehicles;
* it does not include one-time income from selling stuff.