Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
CMoveChannelRestrictions.hpp
Go to the documentation of this file.
1#ifndef LIBS_CHANNELS_CMOVECHANNELRESTRICTIONS_HPP_
2#define LIBS_CHANNELS_CMOVECHANNELRESTRICTIONS_HPP_
3
5
6#include <map>
7
9{
10public:
11 typedef std::pair<TUnitChannel, TUnitChannel> TChannelMove;// <source, destination>
12
15
19
20 std::set<iv::types::unitId> getDstUnitsAllowed(const TUnitChannel &srcUnitChannel);
21 std::set<iv::types::channelOrder> getDstUnitChannelsAllowed(const TUnitChannel &srcUnitChannel, uint16_t dstUnitId);
22
23 bool isValidMove(const TChannelMove &move);
24
25private:
26 bool checkDstUnitNotFull(uint16_t unitId);
27 bool checkDstUnitIsCompatible(const TUnitChannel &srcUnitChannel, uint16_t dstUnitId);
28 bool checkDstUnitOk(const TUnitChannel &srcUnitChannel, uint16_t dstUnitId);
29
30 bool checkDstChannelIsNotSelf(const TUnitChannel &srcUnitChannel, const TUnitChannel &dstUnitChannel);
31 bool checkDstChannelIsCompatible(const TUnitChannel &srcUnitChannel, const TUnitChannel &dstUnitChannel);
32 bool checkDstChannelOk(const TUnitChannel &srcUnitChannel, const TUnitChannel &dstUnitChannel);
33
34 void calculateDstUnitsAllowed(const TUnitChannel &srcUnitChannel);
35 void calculateDstUnitChannelsAllowed(const TUnitChannel &srcUnitChannel, uint16_t dstUnitId);
36
37 std::map<TUnitChannel, std::set<TUnitChannel>>
38 m_mapSrcDstRestrictions;// map of allowed destination TUnitChannel for a given source TUnitChannel
39};
40
41#endif /* LIBS_CHANNELS_CMOVECHANNELRESTRICTIONS_HPP_ */
Definition CMoveChannelRestrictions.hpp:9
CMoveChannelRestrictions & operator=(const CMoveChannelRestrictions &other)=default
void calculateDstUnitsAllowed(const TUnitChannel &srcUnitChannel)
Definition CMoveChannelRestrictions.cpp:154
CMoveChannelRestrictions()
Definition CMoveChannelRestrictions.cpp:10
std::pair< TUnitChannel, TUnitChannel > TChannelMove
Definition CMoveChannelRestrictions.hpp:11
bool checkDstChannelIsCompatible(const TUnitChannel &srcUnitChannel, const TUnitChannel &dstUnitChannel)
Definition CMoveChannelRestrictions.cpp:84
std::set< iv::types::unitId > getDstUnitsAllowed(const TUnitChannel &srcUnitChannel)
Definition CMoveChannelRestrictions.cpp:14
bool checkDstChannelOk(const TUnitChannel &srcUnitChannel, const TUnitChannel &dstUnitChannel)
Definition CMoveChannelRestrictions.cpp:148
void calculateDstUnitChannelsAllowed(const TUnitChannel &srcUnitChannel, uint16_t dstUnitId)
Definition CMoveChannelRestrictions.cpp:180
~CMoveChannelRestrictions()=default
std::set< iv::types::channelOrder > getDstUnitChannelsAllowed(const TUnitChannel &srcUnitChannel, uint16_t dstUnitId)
Definition CMoveChannelRestrictions.cpp:35
CMoveChannelRestrictions(CMoveChannelRestrictions &&other)=delete
bool checkDstUnitOk(const TUnitChannel &srcUnitChannel, uint16_t dstUnitId)
Definition CMoveChannelRestrictions.cpp:73
bool isValidMove(const TChannelMove &move)
Definition CMoveChannelRestrictions.cpp:58
bool checkDstUnitIsCompatible(const TUnitChannel &srcUnitChannel, uint16_t dstUnitId)
Definition CMoveChannelRestrictions.cpp:68
bool checkDstChannelIsNotSelf(const TUnitChannel &srcUnitChannel, const TUnitChannel &dstUnitChannel)
Definition CMoveChannelRestrictions.cpp:78
std::map< TUnitChannel, std::set< TUnitChannel > > m_mapSrcDstRestrictions
Definition CMoveChannelRestrictions.hpp:38
CMoveChannelRestrictions & operator=(CMoveChannelRestrictions &&other)=delete
bool checkDstUnitNotFull(uint16_t unitId)
Definition CMoveChannelRestrictions.cpp:63
Definition CUnitsRestrictions.hpp:16
std::pair< iv::types::unitId, iv::types::channelOrder > TUnitChannel
Definition CUnitsRestrictions.hpp:18