etrobocon2018 feat.KatLab  770af34cce41ae9c30c41303275e1add2daae0c3 (with uncommitted changes)
 全て クラス 名前空間 ファイル 関数 変数 列挙型 列挙値 フレンド マクロ定義 ページ
BlockStrategy.h
[詳解]
1 #ifndef __BLOCK_STRATEGY__
2 #define __BLOCK_STRATEGY__
3 
4 #include "BlockArea.h"
6 #include <array>
7 
8 namespace etrobocon2018_test {
9  class BlockStrategyTest;
10 }
11 
12 namespace BlockSideBySide {
13  static constexpr std::int8_t BLOCK_NUM = 16;
14 
15  class BlockStrategy {
17 
18  public:
19  explicit BlockStrategy(std::int32_t ipc_) : initialPositionCode(ipc_)
20  {
21  createColorBlockPlace();
22  putColorBlock();
23  connectColorBlockPlace();
24  blockArea.colorBlockPlaceArray = colorBlockPlaceArray;
25  }
27  std::vector<std::int8_t> decodedColorBlockCodeList;
28 
29  private:
30  std::int32_t initialPositionCode; // = 1*16^4 + 2*16^3 + 4*16^2 + 5*16^1 + 8
31  std::array<std::shared_ptr<ColorBlockPlace>, BLOCK_NUM> colorBlockPlaceArray;
32  void createColorBlockPlace();
33  void connectColorBlockPlace();
34  void putColorBlock();
35  };
36 } // namespace BlockSideBySide
37 
38 #endif
std::array< std::shared_ptr< ColorBlockPlace >, 16 > colorBlockPlaceArray
Definition: BlockArea.h:53
初期位置コードデコーダークラス
BlockStrategy(std::int32_t ipc_)
Definition: BlockStrategy.h:19
std::vector< std::int8_t > decodedColorBlockCodeList
Definition: BlockStrategy.h:27