Commits

Hirundo  committed 523c52c

[IS] Doc: More documentation added and existing documentation cleaned up.

  • Participants
  • Parent commits 56ca2f5
  • Branches default

Comments (0)

Files changed (3)

File src/company_gui.cpp

 	SSW_WIDGET_RESIZE,
 };
 
+/** Window that shows per-company infrastructure sharing settings and allows changing them */
 struct SharingSettingsWindow : public Window {
 private:
 	/** order of lines in the options tab */
 
 	uint line_height;                     ///< Height of a single line of text + buttons
 
-	/** Draw a string on top of a certain widget.
+	/**
+	 * Draw a string on top of a certain widget.
 	 * @param widget The widget to draw the string on.
 	 * @param y The y-coordinate to draw on.
 	 * @param string The string to draw.
-	 * @param colour TextColour to use */
+	 * @param colour TextColour to use.
+	 */
 	inline void DrawWidgetString(int widget, uint y, StringID string, TextColour colour = TC_FROMSTRING)
 	{
 		NWidgetCore *wi = this->GetWidget<NWidgetCore>(widget);
 		DrawString(wi->pos_x, wi->pos_x + wi->current_x - 1, y, string, colour);
 	}
 
-	/** Draw the value of a boolean setting ([Not] Allowed) in the column 'current' or 'future'.
+	/**
+	 * Draw the value of a boolean setting ([Not] Allowed) in the column 'current' or 'future'.
 	 * @param y The y-coordinate where the string should be drawn.
 	 * @param value The boolean value to draw (Allowed / Not allowed).
-	 * @param column_future If true, draw in the column 'future', if false, draw in the column 'current'. */
+	 * @param column_future If true, draw in the column 'future', if false, draw in the column 'current'.
+	 */
 	inline void DrawBoolValue(uint y, bool value, bool column_future)
 	{
 		this->DrawWidgetString(column_future ? SSW_WIDGET_FUTURE : SSW_WIDGET_CURRENT, y, value ? STR_SHARING_VALUE_ALLOWED : STR_SHARING_VALUE_NOT_ALLOWED);
  	}
 
-	/** Draw a boolean sharing setting.
+	/**
+	 * Draw a boolean sharing setting.
 	 * @param str The string to draw. (any parameters can be set beforehand)
 	 * @param y The y-coordinate where the string should be drawn. Is increased by this->line_height after drawing.
 	 * @param value_current The boolean value to draw (Allowed / Not allowed) in the column 'current'.
 		y += this->line_height;
 	}
 
-	/** Should the text line given by the parameter be drawn on de screen? (depends on scrolling)
+	/**
+	 * Should the text line given by the parameter be drawn on de screen? (depends on scrolling)
 	 * Parameter 'line' is passed by reference, and always incremented by one.
 	 * @param Line the line to draw or not to draw.
 	 * @return True if the line is to be drawn.
 		return this->vscroll.IsVisible(line++);
 	}
 
-	/** Handle a click on a boolean option.
+	/**
+	 * Handle a click on a boolean option.
 	 * @param type The vehicle type that was clicked on.
 	 * @param option Bitmask of sharing options (station/depot/tracks) to be changed.
 	 */
 		DoCommandP(0, MODIFY_SHARING_OPTION | (type << 8), value, CMD_CHANGE_SHARING_SETTING | CMD_MSG(STR_ERROR_CAN_T_CHANGE_SHARING_SETTING));
 	}
 
-	/** Handle a click on one of the fees.
+	/**
+	 * Handle a click on one of the fees.
 	 * @param type The vehicle type for which the fee is to be adjusted.
 	 * @param x The x-coordinate of the click, relative to the left edge of the button.
 	 * This is used to determine whether the left or right button was clicked.
 	NULL, _nested_sharing_settings_widgets, lengthof(_nested_sharing_settings_widgets)
 );
 
+/**
+ * Show the sharing window of a company.
+ * @param company The company whose window to show.
+ */
 static void ShowCompanySharingSettings(CompanyID company)
 {
 	if ((_settings_game.sharing.sharing_mode == SHARING_INDIVIDUAL) && Company::IsValidID(company)) {

File src/economy.cpp

 	}
 }
 
+/**
+ * Update the sharing settings of a all companies, if needed.
+ */
 static void CompaniesUpdateSharing()
 {
 	Company *c;

File src/infrastructure.h

 	/**
 	 * Set the sharing fee for a vehicle type.
 	 * @param type The vehicle type.
-	 * @value The sharing option to set for the given vehicle type.
+	 * @param value The sharing option to set for the given vehicle type.
 	 */
 	FORCEINLINE void SetSharingOption(VehicleType type, byte value)
 	{