Minor refactoring

Signed-off-by: AMZN-Olex <5432499+AMZN-Olex@users.noreply.github.com>
This commit is contained in:
AMZN-Olex
2021-08-02 19:06:02 -04:00
parent 93a3d3efa0
commit 0620f6dff3
4 changed files with 11 additions and 13 deletions
@@ -169,7 +169,6 @@ namespace Multiplayer
m_currentComponentReport = nullptr;
}
m_gdeDirtyBytes.ReportAggregateBytes();
MultiplayerDebugByteReporter::ReportAggregateBytes();
}
@@ -183,7 +182,6 @@ namespace Multiplayer
}
SetEntityName(other.GetEntityName());
m_gdeDirtyBytes.Combine(other.m_gdeDirtyBytes);
}
void MultiplayerDebugEntityReporter::Reset()
@@ -191,7 +189,6 @@ namespace Multiplayer
MultiplayerDebugByteReporter::Reset();
m_componentReports.clear();
m_gdeDirtyBytes.Reset();
}
AZStd::map<AZStd::string, MultiplayerDebugComponentReporter>& MultiplayerDebugEntityReporter::GetComponentReports()
@@ -58,8 +58,6 @@ namespace Multiplayer
using Report = AZStd::pair<AZStd::string, MultiplayerDebugByteReporter*>;
AZStd::vector<Report> GetFieldReports();
AZStd::size_t GetTotalDirtyBits() const { return m_componentDirtyBytes.GetTotalBytes(); }
float GetAvgDirtyBits() const { return m_componentDirtyBytes.GetAverageBytes(); }
void Combine(const MultiplayerDebugComponentReporter& other);
@@ -87,13 +85,10 @@ namespace Multiplayer
}
AZStd::map<AZStd::string, MultiplayerDebugComponentReporter>& GetComponentReports();
AZStd::size_t GetTotalDirtyBits() const { return m_gdeDirtyBytes.GetTotalBytes(); }
float GetAvgDirtyBits() const { return m_gdeDirtyBytes.GetAverageBytes(); }
private:
MultiplayerDebugComponentReporter* m_currentComponentReport = nullptr;
AZStd::map<AZStd::string, MultiplayerDebugComponentReporter> m_componentReports;
MultiplayerDebugByteReporter m_gdeDirtyBytes;
AZStd::string m_entityName;
};
}
@@ -341,17 +341,21 @@ namespace Multiplayer
if (m_displayPerEntityStats)
{
// This overrides @net_DebugNetworkEntity_ShowBandwidth value
if (ImGui::Begin("Multiplayer Per Entity Stats", &m_displayPerEntityStats, ImGuiWindowFlags_AlwaysAutoResize))
{
if (ImGui::Checkbox("Show Bandwidth over Entities", &m_displayPerEntityBandwidth))
{
// This overrides @net_DebugNetworkEntity_ShowBandwidth value
if (m_reporter == nullptr)
{
ShowEntityBandwidthDebugOverlay();
}
}
if (m_reporter)
{
m_reporter->OnImGuiUpdate();
}
else
{
ShowEntityBandwidthDebugOverlay();
}
}
}
}
@@ -60,7 +60,9 @@ namespace Multiplayer
private:
bool m_displayNetworkingStats = false;
bool m_displayMultiplayerStats = false;
bool m_displayPerEntityStats = false;
bool m_displayPerEntityBandwidth = false;
AZStd::unique_ptr<MultiplayerDebugPerEntityReporter> m_reporter;
};