Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/scriptinterface/ScriptStats.h
/* Copyright (C) 2020 Wildfire Games. | /* Copyright (C) 2023 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 18 Lines | |||||
{ | { | ||||
NONCOPYABLE(CScriptStatsTable); | NONCOPYABLE(CScriptStatsTable); | ||||
public: | public: | ||||
CScriptStatsTable(); | CScriptStatsTable(); | ||||
void Add(const ScriptInterface* scriptInterface, const std::string& title); | void Add(const ScriptInterface* scriptInterface, const std::string& title); | ||||
void Remove(const ScriptInterface* scriptInterface); | void Remove(const ScriptInterface* scriptInterface); | ||||
virtual CStr GetName(); | CStr GetName() override; | ||||
virtual CStr GetTitle(); | CStr GetTitle() override; | ||||
virtual size_t GetNumberRows(); | size_t GetNumberRows() override; | ||||
virtual const std::vector<ProfileColumn>& GetColumns(); | const std::vector<ProfileColumn>& GetColumns() override; | ||||
virtual CStr GetCellText(size_t row, size_t col); | CStr GetCellText(size_t row, size_t col) override; | ||||
virtual AbstractProfileTable* GetChild(size_t row); | AbstractProfileTable* GetChild(size_t row) override; | ||||
private: | private: | ||||
std::vector<std::pair<const ScriptInterface*, std::string> > m_ScriptInterfaces; | std::vector<std::pair<const ScriptInterface*, std::string> > m_ScriptInterfaces; | ||||
std::vector<ProfileColumn> m_ColumnDescriptions; | std::vector<ProfileColumn> m_ColumnDescriptions; | ||||
}; | }; | ||||
// To simplify the UI we want to use a single table for all script interfaces, | // To simplify the UI we want to use a single table for all script interfaces, | ||||
// so just make it a global that they can all add themselves to | // so just make it a global that they can all add themselves to | ||||
extern CScriptStatsTable* g_ScriptStatsTable; | extern CScriptStatsTable* g_ScriptStatsTable; | ||||
#endif // INCLUDED_SCRIPTSTATS | #endif // INCLUDED_SCRIPTSTATS |
Wildfire Games · Phabricator