From 34969178db5433cbe8e198d420976c899e72ae2a Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 22 Apr 2012 16:28:27 +0000 Subject: (svn r24169) -Add: Make NewGRFClass distinguish between defined specs and specs visible for the user. --- src/newgrf_class.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/newgrf_class.h') 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 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); -- cgit v1.2.3-54-g00ecf