54 lines
1.0 KiB
C++
54 lines
1.0 KiB
C++
#ifndef SIMULATIONDIALOG_H
|
|
#define SIMULATIONDIALOG_H
|
|
|
|
#include <QDialog>
|
|
|
|
#include "behavior.h"
|
|
#include "map.h"
|
|
|
|
class Simulation;
|
|
class MapScene;
|
|
class QListWidgetItem;
|
|
class QLibrary;
|
|
|
|
namespace Ui {
|
|
class SimulationDialog;
|
|
}
|
|
|
|
class SimulationDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit SimulationDialog(QWidget *parent = 0);
|
|
~SimulationDialog();
|
|
Simulation* getSimulation();
|
|
|
|
protected:
|
|
virtual void resizeEvent(QResizeEvent *);
|
|
|
|
private slots:
|
|
void refreshBehaviors();
|
|
void refreshGenerators();
|
|
void generateMap();
|
|
void updatePreview();
|
|
void selectBehavior(const QModelIndex &index);
|
|
|
|
private:
|
|
Ui::SimulationDialog *ui;
|
|
std::vector<QString> m_genList;
|
|
std::vector<QString> m_behaviorList;
|
|
std::vector<std::pair<BehaviorFunction, DebugBehaviorFunction>> m_selectedBehaviors;
|
|
MapScene *m_map;
|
|
QLibrary *m_currentGeneratorLib;
|
|
QImage *m_currentPreview;
|
|
bool m_availableGenerators;
|
|
|
|
void updatePreviewPixmap();
|
|
|
|
signals:
|
|
void sendError(QString);
|
|
};
|
|
|
|
#endif // SIMULATIONDIALOG_H
|