Started by Sirius, June 13, 2021, 11:55:37 AM
0 Members and 1 Guest are viewing this topic.
Quote from: Freahk on June 13, 2021, 11:55:37 AMI just started to refactor way construction and destruction related code to improve maintainability in the future.Please do not yet pull this, but feel free to note any eventual issues with the code.https://github.com/irgend42/simutrans-extended/pull/new/way-construction-refactoring
Quote32fb582 way_builder::calc_costs refactoring: - reuse forge cost calculation - reuse tree/groundobj removal cost calculation - improve tree/groundobj removal code (do not iterate the obj list from the start for each single tree/groundobj)
Quote2baafffremoved code duplication of get_tree_remove_costs and remove_trees
Quote from: Freahk on June 13, 2021, 02:13:01 PMThe forge cost part shouldn't be an issue at all. As far as I know forge costs are an extended feature.The different approach of remove_trees could be backported to standard. Then, the code difference around tree/groundobj removal shouldn't be an issue.My intention was to first prepare the rafactoring in extended, then prepare a related refactoring in standard.That's because some of those refactorisations are quite useful in extended but might not be needed in standard.