src/window_gui.h
changeset 9182 412cb6c0caf1
parent 9178 3235f895bf12
child 9184 6c18790d3929
--- a/src/window_gui.h	Sun May 11 14:09:38 2008 +0000
+++ b/src/window_gui.h	Sun May 11 14:23:45 2008 +0000
@@ -557,7 +557,6 @@
 	VL_REBUILD = 1 << 2, ///< create sort-listing to use for qsort and friends
 	VL_END     = 1 << 3,
 };
-
 DECLARE_ENUM_AS_BIT_SET(SortListFlags);
 
 struct Listing {
@@ -565,22 +564,14 @@
 	byte criteria; ///< Sorting criteria
 };
 
-struct list_d {
+template <typename T>
+struct GUIList {
+	T* sort_list;        ///< The items to sort.
+	SortListFlags flags; ///< used to control sorting/resorting/etc.
 	uint16 list_length;  ///< length of the list being sorted
+	uint16 resort_timer; ///< resort list after a given amount of ticks if set
 	byte sort_type;      ///< what criteria to sort on
-	SortListFlags flags; ///< used to control sorting/resorting/etc.
-	uint16 resort_timer; ///< resort list after a given amount of ticks if set
 };
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(list_d));
-
-struct vehiclelist_d {
-	const Vehicle** sort_list;  // List of vehicles (sorted)
-	Listing *_sorting;          // pointer to the appropiate subcategory of _sorting
-	uint16 length_of_sort_list; // Keeps track of how many vehicle pointers sort list got space for
-	VehicleType vehicle_type;   // The vehicle type that is sorted
-	list_d l;                   // General list struct
-};
-assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vehiclelist_d));
 
 /****************** THESE ARE NOT WIDGET TYPES!!!!! *******************/
 enum WindowWidgetBehaviours {