Public Member Functions | Data Fields

TownScopeResolver Struct Reference

Scope resolver for a town. More...

#include <newgrf_town.h>

Inheritance diagram for TownScopeResolver:
ScopeResolver

Public Member Functions

 TownScopeResolver (ResolverObject &ro, Town *t, bool readonly)
 Resolver of a town scope.
virtual uint32 GetVariable (byte variable, uint32 parameter, bool *available) const
 Get a variable value.
virtual void StorePSA (uint reg, int32 value)
 Store a value into the persistent storage area (PSA).

Data Fields

Townt
 Town of the scope.
bool readonly
 When set, persistent storage of the town is read-only,.

Detailed Description

Scope resolver for a town.

Note:
Currently there is no direct town resolver; we only need to get town variable results from inside stations, house tiles and industries, and to check the town's persistent storage.

Definition at line 24 of file newgrf_town.h.


Constructor & Destructor Documentation

TownScopeResolver::TownScopeResolver ( ResolverObject ro,
Town t,
bool  readonly 
)

Resolver of a town scope.

Parameters:
ro Surrounding resolver.
t Town of the scope.
readonly Scope may change persistent storage of the town.

Definition at line 23 of file newgrf_town.cpp.


Member Function Documentation

void TownScopeResolver::StorePSA ( uint  reg,
int32  value 
) [virtual]

Store a value into the persistent storage area (PSA).

Default implementation does nothing (for newgrf classes without storage).

Parameters:
pos Position to store into.
value Value to store.

Reimplemented from ScopeResolver.

Definition at line 132 of file newgrf_town.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_persistent_storage_pool >::CanAllocateItem(), GetRegister(), ResolverObject::grffile, GSF_FAKE_TOWNS, readonly, ScopeResolver::ro, PersistentStorageArray< TYPE, SIZE >::StoreValue(), t, and Town::xy.


The documentation for this struct was generated from the following files: