12 #ifndef NEWGRF_OBJECT_H 13 #define NEWGRF_OBJECT_H 92 bool IsEverAvailable()
const;
93 bool WasEverAvailable()
const;
94 bool IsAvailable()
const;
97 static const ObjectSpec *Get(
ObjectType index);
98 static const ObjectSpec *GetByTile(
TileIndex tile);
120 uint32
GetVariable(byte variable, uint32 parameter,
bool *available)
const;
136 return &this->object_scope;
140 if (tsr != NULL)
return tsr;
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope)...
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Maximum number of classes.
ObjectFlags
Various object behaviours.
Object wants 2CC colour mapping.
ObjectFlags flags
Flags/settings related to the object.
Tile information, used while rendering the tile.
Money GetBuildCost() const
Get the cost for building a structure of this type.
ResolverObject & ro
Surrounding resolver object.
uint8 build_cost_multiplier
Build cost multiplier per tile.
Interface for SpriteGroup-s to access the gamestate.
GRFFilePropsBase< 2 > grf_prop
Properties related the the grf file.
void DrawNewObjectTile(TileInfo *ti, const ObjectSpec *spec)
Draw an object on the map.
Class for the less fortunate.
Definitions related to NewGRF animation.
Object can not be removed.
Object wants to be drawn on water.
Set when using the callback resolve system, but not to resolve a callback.
Allow incrementing of ObjectClassID variables.
Date end_of_life_date
When can't this object be built anymore.
Object get automatically removed (like "owned land").
static const CargoID CT_PURCHASE_OBJECT
Mapping of purchase for objects.
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0)
Get a resolver for the scope.
void AnimateNewObjectTile(TileIndex tile)
Handle the animation of the object tile.
Date introduction_date
From when can this object be built.
NewGRFClass< ObjectSpec, ObjectClassID, OBJECT_CLASS_MAX > ObjectClass
Struct containing information relating to object classes.
Callbacks that NewGRFs could implement.
Money GetPrice(Price index, uint cost_factor, const GRFFile *grf_file, int shift)
Determine a certain price.
uint8 size
The size of this objects; low nibble for X, high nibble for Y.
ObjectScopeResolver(ResolverObject &ro, Object *obj, TileIndex tile, uint8 view=0)
Constructor of an object scope resolver.
uint8 height
The height of this structure, in heightlevels; max MAX_TILE_HEIGHT.
ObjectScopeResolver object_scope
The object scope resolver.
Struct containing information relating to NewGRF classes for stations and airports.
uint8 view
The view of the object.
bool enabled
Is this spec enabled?
Types related to object tiles.
Object can only be built in game.
struct Object * obj
The object the callback is ran for.
Money GetClearCost() const
Get the cost for clearing a structure of this type.
void TriggerObjectTileAnimation(Object *o, TileIndex tile, ObjectAnimationTrigger trigger, const ObjectSpec *spec)
Trigger the update of animation on a single tile.
TileIndex tile
The tile related to the object.
Object can only be constructed in the scenario editor.
void TriggerObjectAnimation(Object *o, ObjectAnimationTrigger trigger, const ObjectSpec *spec)
Trigger the update of animation on a whole object.
AnimationInfo animation
Information about the animation.
Scope resolver for a town.
uint16 callback_mask
Bitmask of requested/allowed callbacks.
An object, such as transmitter, on the map.
uint8 views
The number of views.
When object is cleared a positive income is generated instead of a cost.
void DrawNewObjectTileInGUI(int x, int y, const ObjectSpec *spec, uint8 view)
Draw representation of an object (tile) for GUI purposes.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, byte relative=0)
Get a resolver for the scope.
Object can not be on land, implicitly sets OBJECT_FLAG_BUILT_ON_WATER.
uint16 ObjectType
Types of objects.
Object wants random bits in "next animation frame" callback.
uint32 StringID
Numeric value that represents a string, independent of the selected language.
Object has animated tiles.
StringID name
The name for this object.
uint16 GetObjectCallback(CallbackID callback, uint32 param1, uint32 param2, const ObjectSpec *spec, Object *o, TileIndex tile, uint8 view=0)
Perform a callback for an object.
Header file for classes to be used by e.g.
uint8 clear_cost_multiplier
Clear cost multiplier per tile.
Object count is roughly scaled by water amount at edges.
uint32 TileIndex
The index/ID of a Tile.
TownScopeResolver * town_scope
The town scope resolver (created on the first call).
Functions related to the economy.
Related object of the resolved one.
uint32 GetVariable(byte variable, uint32 parameter, bool *available) const
Used by the resolver to get values for feature 0F deterministic spritegroups.
uint8 generate_amount
Number of objects which are attempted to be generated per 256^2 map during world generation.
ObjectAnimationTrigger
Animation triggers for objects.
uint32 GetRandomBits() const
Get a few random bits.
Types related to the dates in OpenTTD.
This file simplyfies and embeds a common mechanism of loading/saving and mapping of grf entities...
Information about animation.
int32 Date
The type to store our dates in.
A resolver object to be used with feature 0F spritegroups.
const struct GRFFile * grffile
grf file that introduced this entity
CallbackID
List of implemented NewGRF callbacks.
Object can be built on water (not required).
Object can built under a bridge.
Functions to handle the town part of NewGRF towns.
byte CargoID
Cargo slots to indicate a cargo type within a game.
#define DECLARE_POSTFIX_INCREMENT(type)
Some enums need to have allowed incrementing (i.e.
ObjectClassID cls_id
The class to which this spec belongs.
uint8 climate
In which climates is this object available?
Do not display foundations when on a slope.
void ResetObjects()
This function initialize the spec arrays of objects.
ObjectClassID
Class IDs for objects.