* For a #CFT_CARGO, compute the left position of the left-most vertical cargo connection. * @param xpos Left position of the field. * @return Left position of the left-most vertical cargo column. */
| 2124 | * @return Left position of the left-most vertical cargo column. |
| 2125 | */ |
| 2126 | int GetCargoBase(int xpos) const |
| 2127 | { |
| 2128 | assert(this->type == CFT_CARGO); |
| 2129 | int n = this->u.cargo.num_cargoes; |
| 2130 | |
| 2131 | return xpos + cargo_field_width / 2 - (CargoesField::cargo_line.width * n + CargoesField::cargo_space.width * (n - 1)) / 2; |
| 2132 | } |
| 2133 | |
| 2134 | /** |
| 2135 | * Draw the field. |
no outgoing calls
no test coverage detected