Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
CMoveChannelRestrictions Class Reference

#include <CMoveChannelRestrictions.hpp>

Inheritance diagram for CMoveChannelRestrictions:
[legend]
Collaboration diagram for CMoveChannelRestrictions:
[legend]

Public Types

typedef std::pair< TUnitChannel, TUnitChannelTChannelMove
 
typedef std::pair< iv::types::unitId, iv::types::channelOrderTUnitChannel
 

Public Member Functions

 CMoveChannelRestrictions ()
 
 ~CMoveChannelRestrictions ()=default
 
 CMoveChannelRestrictions (CMoveChannelRestrictions &&other)=delete
 
CMoveChannelRestrictionsoperator= (const CMoveChannelRestrictions &other)=default
 
CMoveChannelRestrictionsoperator= (CMoveChannelRestrictions &&other)=delete
 
std::set< iv::types::unitIdgetDstUnitsAllowed (const TUnitChannel &srcUnitChannel)
 
std::set< iv::types::channelOrdergetDstUnitChannelsAllowed (const TUnitChannel &srcUnitChannel, uint16_t dstUnitId)
 
bool isValidMove (const TChannelMove &move)
 
std::set< uint16_t > getUsedUnitChannels (uint16_t unitId) const
 

Static Public Member Functions

static std::set< uint16_t > getExistingUnits ()
 
static std::map< iv::types::unitId, iv::units::eUnitTypegetExistingUnitsWithUnitType ()
 
static std::set< uint16_t > getExistingUnitChannels (uint16_t unitId)
 
static std::map< iv::types::channelOrder, iv::types::channelIdgetExistingUnitChannelsWithChannelId (uint16_t unitId)
 
static bool canAddUnit (iv::types::unitId unitId, iv::units::eUnitType unitType, std::string &returnMsg)
 
static bool canAddChannels (std::string &returnMsg)
 
static bool canAddChannel (iv::types::unitId unitId, iv::types::channelOrder channelOrder, iv::channels::eChannelBaseType channelBaseType, std::string &returnMsg)
 
static bool canDeleteChannel (iv::types::unitId unitId, iv::types::channelOrder channelId, std::string &returnMsg)
 
static bool isARestrictedUnit (iv::units::eUnitType unitType)
 
static bool isARestrictedChannel (iv::units::eUnitType unitType, iv::types::channelOrder channelOrder)
 
static bool hasCanAFail (iv::units::eUnitType unitType)
 
static bool hasCanBFail (iv::units::eUnitType unitType)
 
static bool hasCanCFail (iv::units::eUnitType unitType)
 
static bool canAddTanks (std::string &returnMsg)
 
static bool isValidUnitChannel (const TUnitChannel &unitChannel)
 
static bool isChannelWATankChangeable (uint16_t unitId, uint16_t channelId)
 

Private Member Functions

bool checkDstUnitNotFull (uint16_t unitId)
 
bool checkDstUnitIsCompatible (const TUnitChannel &srcUnitChannel, uint16_t dstUnitId)
 
bool checkDstUnitOk (const TUnitChannel &srcUnitChannel, uint16_t dstUnitId)
 
bool checkDstChannelIsNotSelf (const TUnitChannel &srcUnitChannel, const TUnitChannel &dstUnitChannel)
 
bool checkDstChannelIsCompatible (const TUnitChannel &srcUnitChannel, const TUnitChannel &dstUnitChannel)
 
bool checkDstChannelOk (const TUnitChannel &srcUnitChannel, const TUnitChannel &dstUnitChannel)
 
void calculateDstUnitsAllowed (const TUnitChannel &srcUnitChannel)
 
void calculateDstUnitChannelsAllowed (const TUnitChannel &srcUnitChannel, uint16_t dstUnitId)
 

Private Attributes

std::map< TUnitChannel, std::set< TUnitChannel > > m_mapSrcDstRestrictions
 

Member Typedef Documentation

◆ TChannelMove

◆ TUnitChannel

Constructor & Destructor Documentation

◆ CMoveChannelRestrictions() [1/2]

CMoveChannelRestrictions::CMoveChannelRestrictions ( )

◆ ~CMoveChannelRestrictions()

CMoveChannelRestrictions::~CMoveChannelRestrictions ( )
default

◆ CMoveChannelRestrictions() [2/2]

CMoveChannelRestrictions::CMoveChannelRestrictions ( CMoveChannelRestrictions && other)
delete

Member Function Documentation

◆ calculateDstUnitChannelsAllowed()

void CMoveChannelRestrictions::calculateDstUnitChannelsAllowed ( const TUnitChannel & srcUnitChannel,
uint16_t dstUnitId )
private

◆ calculateDstUnitsAllowed()

void CMoveChannelRestrictions::calculateDstUnitsAllowed ( const TUnitChannel & srcUnitChannel)
private

◆ canAddChannel()

bool CUnitsRestrictions::canAddChannel ( iv::types::unitId unitId,
iv::types::channelOrder channelOrder,
iv::channels::eChannelBaseType channelBaseType,
std::string & returnMsg )
staticinherited

canAddChannel returns true if there is no problem in adding the channel to the model; false otherwise.

Parameters
[in]unitIdunitId of the channel to add.
[in]channelOrderm_channelId of the channel to add.
[in]channelBaseTypechannel base type of the channel to add.
[out]returnMsgmessage to return.

◆ canAddChannels()

bool CUnitsRestrictions::canAddChannels ( std::string & returnMsg)
staticinherited

canAddChannels returns true if there are units added and are not of type 'Undefined'; false otherwise.

◆ canAddTanks()

bool CUnitsRestrictions::canAddTanks ( std::string & returnMsg)
staticinherited

◆ canAddUnit()

bool CUnitsRestrictions::canAddUnit ( iv::types::unitId unitId,
iv::units::eUnitType unitType,
std::string & returnMsg )
staticinherited

canAddChannel returns true if there is no problem in adding the unit to the model; false otherwise.

Parameters
[in]unitIdunitId of the unit to add.
[in]unitTypeunitType of the unit to add.
[out]returnMsgmessage to return.

◆ canDeleteChannel()

bool CUnitsRestrictions::canDeleteChannel ( iv::types::unitId unitId,
iv::types::channelOrder channelId,
std::string & returnMsg )
staticinherited

canDeleteChannel returns true if the channel can be deleted; false otherwise.

Parameters
[in]unitIdunitId of the channel to delete.
[in]channelIdm_channelId of the channel to delete.
[out]returnMsgmessage to return.

◆ checkDstChannelIsCompatible()

bool CMoveChannelRestrictions::checkDstChannelIsCompatible ( const TUnitChannel & srcUnitChannel,
const TUnitChannel & dstUnitChannel )
private

◆ checkDstChannelIsNotSelf()

bool CMoveChannelRestrictions::checkDstChannelIsNotSelf ( const TUnitChannel & srcUnitChannel,
const TUnitChannel & dstUnitChannel )
private

◆ checkDstChannelOk()

bool CMoveChannelRestrictions::checkDstChannelOk ( const TUnitChannel & srcUnitChannel,
const TUnitChannel & dstUnitChannel )
private

◆ checkDstUnitIsCompatible()

bool CMoveChannelRestrictions::checkDstUnitIsCompatible ( const TUnitChannel & srcUnitChannel,
uint16_t dstUnitId )
private

◆ checkDstUnitNotFull()

bool CMoveChannelRestrictions::checkDstUnitNotFull ( uint16_t unitId)
private

◆ checkDstUnitOk()

bool CMoveChannelRestrictions::checkDstUnitOk ( const TUnitChannel & srcUnitChannel,
uint16_t dstUnitId )
private

◆ getDstUnitChannelsAllowed()

std::set< iv::types::channelOrder > CMoveChannelRestrictions::getDstUnitChannelsAllowed ( const TUnitChannel & srcUnitChannel,
uint16_t dstUnitId )

◆ getDstUnitsAllowed()

std::set< iv::types::unitId > CMoveChannelRestrictions::getDstUnitsAllowed ( const TUnitChannel & srcUnitChannel)

◆ getExistingUnitChannels()

std::set< iv::types::channelOrder > CUnitsRestrictions::getExistingUnitChannels ( uint16_t unitId)
staticnodiscardinherited

◆ getExistingUnitChannelsWithChannelId()

std::map< iv::types::channelOrder, iv::types::channelId > CUnitsRestrictions::getExistingUnitChannelsWithChannelId ( uint16_t unitId)
staticnodiscardinherited

◆ getExistingUnits()

std::set< uint16_t > CUnitsRestrictions::getExistingUnits ( )
staticnodiscardinherited

◆ getExistingUnitsWithUnitType()

std::map< iv::types::unitId, iv::units::eUnitType > CUnitsRestrictions::getExistingUnitsWithUnitType ( )
staticnodiscardinherited

◆ getUsedUnitChannels()

std::set< uint16_t > CUnitsRestrictions::getUsedUnitChannels ( uint16_t unitId) const
nodiscardinherited

◆ hasCanAFail()

bool CUnitsRestrictions::hasCanAFail ( iv::units::eUnitType unitType)
staticinherited

◆ hasCanBFail()

bool CUnitsRestrictions::hasCanBFail ( iv::units::eUnitType unitType)
staticinherited

◆ hasCanCFail()

bool CUnitsRestrictions::hasCanCFail ( iv::units::eUnitType unitType)
staticinherited

◆ isARestrictedChannel()

bool CUnitsRestrictions::isARestrictedChannel ( iv::units::eUnitType unitType,
iv::types::channelOrder channelOrder )
staticinherited

◆ isARestrictedUnit()

bool CUnitsRestrictions::isARestrictedUnit ( iv::units::eUnitType unitType)
staticinherited

◆ isChannelWATankChangeable()

bool CUnitsRestrictions::isChannelWATankChangeable ( uint16_t unitId,
uint16_t channelId )
staticnodiscardinherited

◆ isValidMove()

bool CMoveChannelRestrictions::isValidMove ( const TChannelMove & move)

◆ isValidUnitChannel()

bool CUnitsRestrictions::isValidUnitChannel ( const TUnitChannel & unitChannel)
staticnodiscardinherited

◆ operator=() [1/2]

CMoveChannelRestrictions & CMoveChannelRestrictions::operator= ( CMoveChannelRestrictions && other)
delete

◆ operator=() [2/2]

CMoveChannelRestrictions & CMoveChannelRestrictions::operator= ( const CMoveChannelRestrictions & other)
default

Member Data Documentation

◆ m_mapSrcDstRestrictions

std::map<TUnitChannel, std::set<TUnitChannel> > CMoveChannelRestrictions::m_mapSrcDstRestrictions
private

The documentation for this class was generated from the following files: