| 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_AI_FIND_ITEM component type. |
| 14 |
* |
| 15 |
* An COMP_AI_FIND_ITEM component doesn't use specifiers. |
| 16 |
*/ |
| 17 |
class AIFindItemComponentEditor : |
| 18 |
public ComponentEditorBase |
| 19 |
{ |
| 20 |
// Registration class |
| 21 |
static struct RegHelper |
| 22 |
{ |
| 23 |
RegHelper() { |
| 24 |
ComponentEditorFactory::registerType( |
| 25 |
objectives::ComponentType::COMP_AI_FIND_ITEM().getName(), |
| 26 |
ComponentEditorPtr(new AIFindItemComponentEditor()) |
| 27 |
); |
| 28 |
} |
| 29 |
} regHelper; |
| 30 |
|
| 31 |
// Component to edit |
| 32 |
Component* _component; |
| 33 |
|
| 34 |
/** |
| 35 |
* Construct a default AIFindItemComponentEditor. |
| 36 |
*/ |
| 37 |
AIFindItemComponentEditor() : |
| 38 |
_component(NULL) |
| 39 |
{} |
| 40 |
|
| 41 |
/** |
| 42 |
* Construct a AIFindItemComponentEditor with a Component object to display and |
| 43 |
* edit. |
| 44 |
* |
| 45 |
* @param component |
| 46 |
* The Component to edit. |
| 47 |
*/ |
| 48 |
AIFindItemComponentEditor(wxWindow* parent, Component& component); |
| 49 |
|
| 50 |
public: |
| 51 |
/* ComponentEditor implementation */ |
| 52 |
|
| 53 |
ComponentEditorPtr create(wxWindow* parent, Component& component) const |
| 54 |
{ |
| 55 |
return ComponentEditorPtr(new AIFindItemComponentEditor(parent, component)); |
| 56 |
} |
| 57 |
|
| 58 |
void writeToComponent() const; |
| 59 |
}; |
| 60 |
|
| 61 |
} // namespace ce |
| 62 |
|
| 63 |
} // namespace objectives |