16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 11:39:19 +02:00

reformat: parameters can be made pointer to const

This commit is contained in:
jerrrrycho
2026-07-04 07:14:02 +02:00
parent 220689a5e3
commit 96a099acdf
51 changed files with 304 additions and 304 deletions

View File

@@ -429,7 +429,7 @@ basic_cell::erase( TAnimModel *Instance ) {
m_instancetranslucent.erase(
std::remove_if(
std::begin( m_instancetranslucent ), std::end( m_instancetranslucent ),
[=]( TAnimModel *instance ) {
[=](const TAnimModel *instance ) {
return instance == Instance; } ),
std::end( m_instancetranslucent ) );
}
@@ -439,7 +439,7 @@ basic_cell::erase( TAnimModel *Instance ) {
m_instancesopaque.erase(
std::remove_if(
std::begin( m_instancesopaque ), std::end( m_instancesopaque ),
[=]( TAnimModel *instance ) {
[=](const TAnimModel *instance ) {
return instance == Instance; } ),
std::end( m_instancesopaque ) );
// also remove from the per-(pModel, skins) instance bucket if present
@@ -466,12 +466,12 @@ basic_cell::erase( TAnimModel *Instance ) {
// removes provided memory cell from the cell
void
basic_cell::erase( TMemCell *Memorycell ) {
basic_cell::erase(const TMemCell *Memorycell ) {
m_memorycells.erase(
std::remove_if(
std::begin( m_memorycells ), std::end( m_memorycells ),
[=]( TMemCell *memorycell ) {
[=](const TMemCell *memorycell ) {
return memorycell == Memorycell; } ),
std::end( m_memorycells ) );
}
@@ -675,7 +675,7 @@ glm::vec3 basic_cell::find_nearest_track_point(const glm::dvec3 &pos)
// executes event assigned to specified launcher
void
basic_cell::launch_event( TEventLauncher *Launcher, const bool local_only ) {
basic_cell::launch_event(const TEventLauncher *Launcher, const bool local_only ) {
WriteLog( "Eventlauncher: " + Launcher->name() );
if (!local_only) {
if( Launcher->Event1 ) {

View File

@@ -150,7 +150,7 @@ public:
erase( TAnimModel *Instance );
// removes provided memory cell from the cell
void
erase( TMemCell *Memorycell );
erase(const TMemCell *Memorycell );
// find a vehicle located nearest to specified point, within specified radius. reurns: located vehicle and distance
std::tuple<TDynamicObject *, float>
find( glm::dvec3 const &Point, float Radius, bool Onlycontrolled, bool Findbycoupler ) const;
@@ -214,7 +214,7 @@ public:
using memorycell_sequence = std::vector<TMemCell *>;
// methods
static void
launch_event(TEventLauncher *Launcher, bool local_only);
launch_event(const TEventLauncher *Launcher, bool local_only);
void
enclose_area( basic_node *Node );
// members

View File

@@ -53,7 +53,7 @@ node_groups::close()
return handle();
}
bool node_groups::assign_cross_switch(map::track_switch& sw, std::string &sw_name, std::string const &id, const size_t idx)
bool node_groups::assign_cross_switch(map::track_switch& sw, const std::string &sw_name, std::string const &id, const size_t idx)
{
sw.action[idx] = simulation::Events.FindEvent(sw_name + ":" + id);
if (!sw.action[idx])

View File

@@ -65,7 +65,7 @@ private:
group_handle
create_handle();
static bool
assign_cross_switch(map::track_switch&sw, std::string &sw_name, const std::string &id, size_t idx);
assign_cross_switch(map::track_switch&sw, const std::string &sw_name, const std::string &id, size_t idx);
// members
group_map m_groupmap; // map of established node groups
std::stack<group_handle> m_activegroup; // helper, group to be assigned to newly created nodes