Codechange: [Script] do not redefine types in the script API

Also move includes to the locations where they are actually used
This commit is contained in:
Rubidium 2025-01-21 23:09:31 +01:00 committed by rubidium42
parent 45444f9666
commit 9a21ca31f8
13 changed files with 22 additions and 9 deletions

View File

@ -12,6 +12,7 @@
#include "script_object.hpp"
#include "../../airport.h"
#include "../../station_type.h"
/**
* Class that handles all airport related functions.

View File

@ -11,6 +11,7 @@
#define SCRIPT_BRIDGE_HPP
#include "script_vehicle.hpp"
#include "../../bridge.h"
/**
* Class that handles all bridge related functions.

View File

@ -11,6 +11,8 @@
#define SCRIPT_CARGOLIST_HPP
#include "script_list.hpp"
#include "../../industry_type.h"
#include "../../station_type.h"
/**
* Creates a list of cargoes that can be produced in the current game.

View File

@ -11,6 +11,7 @@
#define SCRIPT_CONTROLLER_HPP
#include "script_types.hpp"
#include "../../company_type.h"
/**
* The Controller, the class each Script should extend. It creates the Script,

View File

@ -13,6 +13,12 @@
#include "script_event.hpp"
#include "script_goal.hpp"
#include "script_window.hpp"
#include "../../engine_type.h"
#include "../../industry_type.h"
#include "../../station_type.h"
#include "../../story_type.h"
#include "../../subsidy_type.h"
#include "../../vehicle_type.h"
/**
* Event Vehicle Crash, indicating a vehicle of yours is crashed.

View File

@ -11,6 +11,7 @@
#define SCRIPT_INDUSTRYTYPE_HPP
#include "script_list.hpp"
#include "../../industry_type.h"
/**
* Class that handles all industry-type related functions.

View File

@ -11,6 +11,7 @@
#define SCRIPT_MARINE_HPP
#include "script_error.hpp"
#include "../../station_type.h"
/**
* Class that handles all marine related functions.

View File

@ -11,7 +11,9 @@
#define SCRIPT_RAIL_HPP
#include "script_tile.hpp"
#include "../../industry_type.h"
#include "../../signal_type.h"
#include "../../station_type.h"
#include "../../track_type.h"
/**

View File

@ -12,6 +12,7 @@
#include "script_company.hpp"
#include "script_error.hpp"
#include "../../signs_type.h"
/**
* Class that handles all sign related functions.

View File

@ -12,6 +12,7 @@
#include "script_company.hpp"
#include "script_date.hpp"
#include "../../subsidy_type.h"
/**
* Class that handles all subsidy related functions.

View File

@ -12,6 +12,7 @@
#include "script_station.hpp"
#include "script_list.hpp"
#include "../../industry_type.h"
/**
* Creates an empty list, in which you can add tiles.

View File

@ -104,11 +104,9 @@
#ifndef SCRIPT_TYPES_HPP
#define SCRIPT_TYPES_HPP
#include "../../core/overflowsafe_type.hpp"
#include "../../company_type.h"
#include "../../tile_type.h"
#include <squirrel.h>
#ifdef DOXYGEN_API
/* Define all types here, so they are added to the API docs. */
typedef uint BridgeType; ///< The ID of a bridge type.
typedef uint8_t CargoType; ///< The ID of a cargo type.
@ -117,11 +115,7 @@ typedef uint16_t GoalID; ///< The ID of a goal.
typedef uint16_t GroupID; ///< The ID of a group.
typedef uint16_t IndustryID; ///< The ID of an industry.
typedef uint8_t IndustryType; ///< The ID of an industry-type.
#ifdef DOXYGEN_API
typedef int64_t Money; ///< Money, stored in a 32bit/64bit safe way. For scripts money is always in pounds.
#else
typedef OverflowSafeInt64 Money;
#endif /* DOXYGEN_API */
typedef uint16_t ObjectType; ///< The ID of an object-type.
typedef uint16_t SignID; ///< The ID of a sign.
typedef uint16_t StationID; ///< The ID of a station.
@ -129,11 +123,10 @@ typedef uint32_t StringID; ///< The ID of a string.
typedef uint16_t SubsidyID; ///< The ID of a subsidy.
typedef uint16_t StoryPageID; ///< The ID of a story page.
typedef uint16_t StoryPageElementID; ///< The ID of a story page element.
#ifdef DOXYGEN_API
typedef uint32_t TileIndex; ///< The ID of a map location.
#endif /* DOXYGEN_API */
typedef uint16_t TownID; ///< The ID of a town.
typedef uint32_t VehicleID; ///< The ID of a vehicle.
#endif /* DOXYGEN_API */
/**
* The types of errors inside the script framework.

View File

@ -11,6 +11,8 @@
#define SCRIPT_VEHICLE_HPP
#include "script_road.hpp"
#include "../../engine_type.h"
#include "../../group_type.h"
/**
* Class that handles all vehicle related functions.