/** * @RDE_HEADER@ * Interface of MineField * $Id$ * $HeadURL$ * $Author$ */ #pragma once #include "abstract_multi_point_map_object.h" #include //---------------------------------------------------------------------------- namespace SituationMap { /** * @brief The MineField class supports MineFields with Activated and DeActivated mines. */ class MineField : public virtual AbstractMultiPointMapObject, public virtual AbstractEffectSimulation { using BaseClass = AbstractMapObject; public: enum class MineState { Activated, ///< live, aimed DeActivated ///< }; public: /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Don't use "= default" because of bug in VS2015 JT 2016/11/7 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ MineField() : AbstractMultiPointMapObject(), AbstractEffectSimulation() { ; } virtual ~MineField() = default; ///< Destructor /*! \name Segments */ //@{ virtual PositionCont segment(int key) const = 0; /** * @brief Set positions of one segment. * @param key of segment to be set. * @param posCont positions of segment. * @note: is key is negativ, no fill pattern is aplied. * If key is >=0, the pattern of the segments take over the main pattern. */ virtual void setSegment(int key, const PositionCont &posCont) = 0; /** * @brief Remove one segment * @param key to be removed. */ virtual void removeSegment(int key) = 0; /** * @brief Remove all segments. */ virtual void removeSegments() = 0; /** * @brief Get a list of keys in use. * @return List of keys in use. */ virtual QList keysInUse() const = 0; /*! \name Positions of Mines */ //@{ /** * @brief Set all positions of mines (of all states) * @param mineState to be set. * @param posCont positions of mines to be set. */ virtual void setPositionsMine(MineState mineState, const PositionCont &posCont) = 0; //@} virtual bool mineVisibility(MineState mineState) const = 0; virtual void setMineVisibility(MineState mineState, bool visible) = 0; }; } // namespace SituationMap