| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "ComponentEditorBase.h" |
| 4 |
#include "ComponentEditorFactory.h" |
| 5 |
#include "SpecifierEditCombo.h" |
| 6 |
#include "../ComponentType.h" |
| 7 |
|
| 8 |
namespace objectives { |
| 9 |
|
| 10 |
namespace ce { |
| 11 |
|
| 12 |
/** |
| 13 |
* ComponentEditor subclass for COMP_READABLE_OPENED component type. |
| 14 |
* |
| 15 |
* This component requires that the player opens a certain readable. |
| 16 |
*/ |
| 17 |
class ReadableOpenedComponentEditor : |
| 18 |
public ComponentEditorBase |
| 19 |
{ |
| 20 |
private: |
| 21 |
// Registration class |
| 22 |
static struct RegHelper |
| 23 |
{ |
| 24 |
RegHelper() { |
| 25 |
ComponentEditorFactory::registerType( |
| 26 |
objectives::ComponentType::COMP_READABLE_OPENED().getName(), |
| 27 |
ComponentEditorPtr(new ReadableOpenedComponentEditor()) |
| 28 |
); |
| 29 |
} |
| 30 |
} regHelper; |
| 31 |
|
| 32 |
// Component to edit |
| 33 |
Component* _component; |
| 34 |
|
| 35 |
// SpecifierEditCombo for the readable |
| 36 |
SpecifierEditCombo* _readableSpec; |
| 37 |
|
| 38 |
/** |
| 39 |
* Construct a default ReadableOpenedComponentEditor. |
| 40 |
*/ |
| 41 |
ReadableOpenedComponentEditor() : |
| 42 |
_component(NULL) |
| 43 |
{} |
| 44 |
|
| 45 |
/** |
| 46 |
* Construct an ReadableOpenedComponentEditor with a Component object to display and |
| 47 |
* edit. |
| 48 |
* |
| 49 |
* @param component |
| 50 |
* The Component to edit. |
| 51 |
*/ |
| 52 |
ReadableOpenedComponentEditor(wxWindow* parent, Component& component); |
| 53 |
|
| 54 |
public: |
| 55 |
/* ComponentEditor implementation */ |
| 56 |
|
| 57 |
ComponentEditorPtr create(wxWindow* parent, Component& component) const |
| 58 |
{ |
| 59 |
return ComponentEditorPtr(new ReadableOpenedComponentEditor(parent, component)); |
| 60 |
} |
| 61 |
|
| 62 |
void writeToComponent() const; |
| 63 |
}; |
| 64 |
|
| 65 |
} // namespace ce |
| 66 |
|
| 67 |
} // namespace objectives |