src/newgrf_station.cpp
branchgamebalance
changeset 9895 7bd07f43b0e3
parent 6474 24e7ceeb25f5
child 6669 487ac09b95c4
child 9505 9711235f5693
child 9906 6f41b8713b65
equal deleted inserted replaced
9894:70d78ac95d6c 9895:7bd07f43b0e3
    29 /**
    29 /**
    30  * Reset station classes to their default state.
    30  * Reset station classes to their default state.
    31  * This includes initialising the Default and Waypoint classes with an empty
    31  * This includes initialising the Default and Waypoint classes with an empty
    32  * entry, for standard stations and waypoints.
    32  * entry, for standard stations and waypoints.
    33  */
    33  */
    34 void ResetStationClasses(void)
    34 void ResetStationClasses()
    35 {
    35 {
    36 	for (StationClassID i = STAT_CLASS_BEGIN; i < STAT_CLASS_MAX; i++) {
    36 	for (StationClassID i = STAT_CLASS_BEGIN; i < STAT_CLASS_MAX; i++) {
    37 		station_classes[i].id = 0;
    37 		station_classes[i].id = 0;
    38 		station_classes[i].name = STR_EMPTY;
    38 		station_classes[i].name = STR_EMPTY;
    39 		station_classes[i].stations = 0;
    39 		station_classes[i].stations = 0;
    93 }
    93 }
    94 
    94 
    95 /** Build a list of station class name StringIDs to use in a dropdown list
    95 /** Build a list of station class name StringIDs to use in a dropdown list
    96  * @return Pointer to a (static) array of StringIDs
    96  * @return Pointer to a (static) array of StringIDs
    97  */
    97  */
    98 StringID *BuildStationClassDropdown(void)
    98 StringID *BuildStationClassDropdown()
    99 {
    99 {
   100 	/* Allow room for all station classes, plus a terminator entry */
   100 	/* Allow room for all station classes, plus a terminator entry */
   101 	static StringID names[STAT_CLASS_MAX + 1];
   101 	static StringID names[STAT_CLASS_MAX + 1];
   102 	uint i;
   102 	uint i;
   103 
   103 
   113 
   113 
   114 /**
   114 /**
   115  * Get the number of station classes in use.
   115  * Get the number of station classes in use.
   116  * @return Number of station classes.
   116  * @return Number of station classes.
   117  */
   117  */
   118 uint GetNumStationClasses(void)
   118 uint GetNumStationClasses()
   119 {
   119 {
   120 	uint i;
   120 	uint i;
   121 	for (i = 0; i < STAT_CLASS_MAX && station_classes[i].id != 0; i++);
   121 	for (i = 0; i < STAT_CLASS_MAX && station_classes[i].id != 0; i++);
   122 	return i;
   122 	return i;
   123 }
   123 }