Merge branch 'master' into jgrpp

# Conflicts:
#	src/cargotype.h
#	src/core/CMakeLists.txt
#	src/core/span_type.hpp
#	src/fileio.cpp
#	src/fios.cpp
#	src/misc/endian_buffer.hpp
#	src/misc_gui.cpp
#	src/saveload/saveload.h
#	src/saveload/vehicle_sl.cpp
#	src/screenshot.cpp
#	src/settings.cpp
#	src/settings_internal.h
#	src/stdafx.h
#	src/string_func.h
#	src/strings.cpp
#	src/strings_func.h
#	src/strings_internal.h
This commit is contained in:
Jonathan G Rennison
2024-01-25 18:37:23 +00:00
49 changed files with 127 additions and 472 deletions

View File

@@ -121,8 +121,8 @@ private:
uint received_demand; ///< Received demand towards this node.
PathList paths; ///< Paths through this node, sorted so that those with flow == 0 are in the back.
FlowStatMap flows; ///< Planned flows to other nodes.
span<DemandAnnotation> demands; ///< Demand annotations belonging to this node.
span<Edge> edges; ///< Edges with annotations belonging to this node.
std::span<DemandAnnotation> demands; ///< Demand annotations belonging to this node.
std::span<Edge> edges; ///< Edges with annotations belonging to this node.
void Init(uint supply);
};
@@ -232,12 +232,12 @@ public:
this->node_anno.received_demand += amount;
}
span<DemandAnnotation> GetDemandAnnotations() const
std::span<DemandAnnotation> GetDemandAnnotations() const
{
return this->node_anno.demands;
}
void SetDemandAnnotations(span<DemandAnnotation> demands)
void SetDemandAnnotations(std::span<DemandAnnotation> demands)
{
this->node_anno.demands = demands;
}
@@ -252,7 +252,7 @@ public:
return empty_edge;
}
span<Edge> GetEdges()
std::span<Edge> GetEdges()
{
return this->node_anno.edges;
}

View File

@@ -134,8 +134,9 @@ public:
void SetNode(NodeID, NodeID node)
{
Node node_anno = this->job[node];
this->i = node_anno.GetEdges().begin();
this->end = node_anno.GetEdges().end();
std::span<Edge> edges = node_anno.GetEdges();
this->i = edges.data();
this->end = edges.data() + edges.size();
this->node = node;
}