allow multi-select for ships/stations, mixable with scrap
This commit is contained in:
@@ -4,7 +4,7 @@ SET(HDRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/TickAdvancedEvent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/BuildingBlocksChangedEvent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ExpansionCostChangedEvent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/EntitySelectedEvent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/EntitySelectionChangedEvent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/GameSpeedChangedEvent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/BossWaveUpdatedEvent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/SchematicChoicesAvailableEvent.h
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#ifndef ENTITY_SELECTED_EVENT_H
|
||||
#define ENTITY_SELECTED_EVENT_H
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "entt/entity/entity.hpp"
|
||||
|
||||
#include "Event.h"
|
||||
|
||||
class EntitySelectedEvent : public Event
|
||||
{
|
||||
public:
|
||||
explicit EntitySelectedEvent(std::optional<entt::entity> entity)
|
||||
: entity(entity)
|
||||
{
|
||||
}
|
||||
|
||||
const std::optional<entt::entity> entity;
|
||||
};
|
||||
|
||||
#endif // ENTITY_SELECTED_EVENT_H
|
||||
25
src/lib/eventsystem/event/EntitySelectionChangedEvent.h
Normal file
25
src/lib/eventsystem/event/EntitySelectionChangedEvent.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef ENTITY_SELECTION_CHANGED_EVENT_H
|
||||
#define ENTITY_SELECTION_CHANGED_EVENT_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "entt/entity/entity.hpp"
|
||||
|
||||
#include "Event.h"
|
||||
|
||||
// The set of currently selected ships and/or defence stations. An empty list means
|
||||
// no actor is selected. Actors share the "field" selection category with scrap piles
|
||||
// (REQ-UI-SELECTION-CATEGORIES): they can be selected together, but never together with
|
||||
// buildings.
|
||||
class EntitySelectionChangedEvent : public Event
|
||||
{
|
||||
public:
|
||||
explicit EntitySelectionChangedEvent(std::vector<entt::entity> entities)
|
||||
: entities(std::move(entities))
|
||||
{
|
||||
}
|
||||
|
||||
const std::vector<entt::entity> entities;
|
||||
};
|
||||
|
||||
#endif // ENTITY_SELECTION_CHANGED_EVENT_H
|
||||
Reference in New Issue
Block a user