diff options
author | frosch <frosch@openttd.org> | 2012-04-22 16:28:27 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-04-22 16:28:27 +0000 |
commit | 34969178db5433cbe8e198d420976c899e72ae2a (patch) | |
tree | bbc47721773f360007e03639a9ebc8e8042d2e19 /src/newgrf_class.h | |
parent | 6d9a0ff72396fc99151878e551fd0756ef71ce64 (diff) | |
download | openttd-34969178db5433cbe8e198d420976c899e72ae2a.tar.xz |
(svn r24169) -Add: Make NewGRFClass distinguish between defined specs and specs visible for the user.
Diffstat (limited to 'src/newgrf_class.h')
-rw-r--r-- | src/newgrf_class.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/newgrf_class.h b/src/newgrf_class.h index 0690c6a51..2dfeceba3 100644 --- a/src/newgrf_class.h +++ b/src/newgrf_class.h @@ -21,6 +21,7 @@ template <typename Tspec, typename Tid, Tid Tmax> struct NewGRFClass { private: uint count; ///< Number of specs in this class. + uint ui_count; ///< Number of specs in this class potentially available to the user. Tspec **spec; ///< Array of specifications. /** @@ -43,13 +44,19 @@ public: /** Get the number of allocated specs within the class. */ uint GetSpecCount() const { return this->count; } + /** Get the number of potentially user-available specs within the class. */ + uint GetUISpecCount() const { return this->ui_count; } const Tspec *GetSpec(uint index) const; + /** Check whether the spec will be available to the user at some point in time. */ + bool IsUIAvailable(uint index) const; + static void Reset(); static Tid Allocate(uint32 global_id); static void Assign(Tspec *spec); static uint GetClassCount(); + static uint GetUIClassCount(); static NewGRFClass *Get(Tid cls_id); static const Tspec *GetByGrf(uint32 grfid, byte local_id, int *index); |