|
@@ -5,25 +5,25 @@
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
*/
|
|
|
|
|
|
/** @file newgrf_object.h Functions related to NewGRF objects. */
|
|
|
|
|
|
#ifndef NEWGRF_OBJECT_H
|
|
|
#define NEWGRF_OBJECT_H
|
|
|
|
|
|
#include "newgrf_callbacks.h"
|
|
|
#include "newgrf_spritegroup.h"
|
|
|
#include "newgrf_town.h"
|
|
|
#include "economy_func.h"
|
|
|
#include "date_type.h"
|
|
|
#include "timer/timer_game_calendar.h"
|
|
|
#include "object_type.h"
|
|
|
#include "newgrf_animation_type.h"
|
|
|
#include "newgrf_class.h"
|
|
|
#include "newgrf_commons.h"
|
|
|
|
|
|
/** Various object behaviours. */
|
|
|
enum ObjectFlags : uint16 {
|
|
|
OBJECT_FLAG_NONE = 0, ///< Just nothing.
|
|
|
OBJECT_FLAG_ONLY_IN_SCENEDIT = 1 << 0, ///< Object can only be constructed in the scenario editor.
|
|
|
OBJECT_FLAG_CANNOT_REMOVE = 1 << 1, ///< Object can not be removed.
|
|
|
OBJECT_FLAG_AUTOREMOVE = 1 << 2, ///< Object get automatically removed (like "owned land").
|
|
|
OBJECT_FLAG_BUILT_ON_WATER = 1 << 3, ///< Object can be built on water (not required).
|
|
@@ -59,26 +59,26 @@ DECLARE_POSTFIX_INCREMENT(ObjectClassID)
|
|
|
*/
|
|
|
struct ObjectSpec {
|
|
|
/* 2 because of the "normal" and "buy" sprite stacks. */
|
|
|
GRFFilePropsBase<2> grf_prop; ///< Properties related the the grf file
|
|
|
AnimationInfo animation; ///< Information about the animation.
|
|
|
ObjectClassID cls_id; ///< The class to which this spec belongs.
|
|
|
StringID name; ///< The name for this object.
|
|
|
|
|
|
uint8 climate; ///< In which climates is this object available?
|
|
|
uint8 size; ///< The size of this objects; low nibble for X, high nibble for Y.
|
|
|
uint8 build_cost_multiplier; ///< Build cost multiplier per tile.
|
|
|
uint8 clear_cost_multiplier; ///< Clear cost multiplier per tile.
|
|
|
Date introduction_date; ///< From when can this object be built.
|
|
|
Date end_of_life_date; ///< When can't this object be built anymore.
|
|
|
TimerGameCalendar::Date introduction_date; ///< From when can this object be built.
|
|
|
TimerGameCalendar::Date end_of_life_date; ///< When can't this object be built anymore.
|
|
|
ObjectFlags flags; ///< Flags/settings related to the object.
|
|
|
uint16 callback_mask; ///< Bitmask of requested/allowed callbacks.
|
|
|
uint8 height; ///< The height of this structure, in heightlevels; max MAX_TILE_HEIGHT.
|
|
|
uint8 views; ///< The number of views.
|
|
|
uint8 generate_amount; ///< Number of objects which are attempted to be generated per 256^2 map during world generation.
|
|
|
|
|
|
/**
|
|
|
* Test if this object is enabled.
|
|
|
* @return True iif this object is enabled.
|
|
|
*/
|
|
|
bool IsEnabled() const { return this->views > 0; }
|
|
|
|