Import Picking and placing single houses in scenario editor patch

Minor whitespace fixes

http://www.tt-forums.net/viewtopic.php?f=33&t=68894&view=unread#p1099696
This commit is contained in:
patch-import
2015-08-03 21:29:03 +01:00
committed by Jonathan G Rennison
parent e6782df9ba
commit 19dcbb1cb9
20 changed files with 1495 additions and 264 deletions

View File

@@ -31,6 +31,24 @@ struct TownScopeResolver : public ScopeResolver {
virtual void StorePSA(uint reg, int32 value);
};
/**
* Fake scope resolver for nonexistent towns.
*
* The purpose of this class is to provide a house resolver for a given house type
* but not an actual house instatntion. We need this when e.g. drawing houses in
* GUI to keep backward compatibility with GRFs that were created before this
* functionality. When querying house sprites, certain GRF may read various town
* variables e.g. the population. Since the building doesn't exists and is not
* bounded to any town we have no real values that we can return. Instead of
* failing, this resolver will return fake values.
*/
struct FakeTownScopeResolver : public ScopeResolver {
FakeTownScopeResolver(ResolverObject &ro) : ScopeResolver(ro)
{ }
virtual uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
};
/** Resolver of town properties. */
struct TownResolverObject : public ResolverObject {
TownScopeResolver town_scope; ///< Scope resolver specific for towns.