D'angband  0.0.0
Deeangband
 全て クラス 名前空間 ファイル 関数 変数 型定義 列挙型 列挙値 フレンド マクロ定義 ページ
Field.h
[詳解]
1 
9 #pragma once
10 
11 #include "stdafx.h"
12 #include "Deeangband.h"
13 
14 #include "Dungeon.h"
15 #include "GameWorld.h"
16 #include "GameInstance.h"
17 #include "Square.h"
18 #include "Door.h"
19 #include "TrapBase.h"
20 #include "Trap.h"
21 #include "Item.h"
22 
23 namespace Deeangband
24 {
25 
30  class Field : public GameInstance
31  {
32  private:
33  std::vector<std::vector<boost::shared_ptr<Square>>> squares;
34  std::vector<boost::shared_ptr<Creature>> creatures;
35  std::vector<boost::shared_ptr<Door>> doors;
36  std::vector<boost::shared_ptr<Trap>> traps;
37  std::vector<boost::shared_ptr<Item>> items;
40  bool generated;
42 
44 
51  template<class Archive> void serialize(Archive &archive, const unsigned int version)
52  {
53  if(version >= 0)
54  {
55  archive & boost::serialization::make_nvp("Squares", squares);
56  archive & boost::serialization::make_nvp("Doors", doors);
57  archive & boost::serialization::make_nvp("Traps", traps);
58  archive & boost::serialization::make_nvp("Items", items);
59  archive & boost::serialization::make_nvp("Doors", doors);
60  archive & boost::serialization::make_nvp("Width", width);
61  archive & boost::serialization::make_nvp("Height", height);
62  }
63  }
64 
65  public:
66 
80  Field::Field(std::map<TAG, boost::shared_ptr<Dungeon>>::iterator dungeonIt, DEPTH depth);
81 
82 
86  Field::Field();
87 
92  Field::‾Field();
93 
98  void Field::WipeData(void);
99 
104  MAP_LENGTH Field::GetWidth(void);
105 
110  MAP_LENGTH Field::GetHeight(void);
111 
119  bool Field::SetSize(MAP_LENGTH width, MAP_LENGTH height);
120 
125  Square *Field::GetSquare(MAP_LENGTH x, MAP_LENGTH y);
126 
136  bool Field::GenerateTrap(std::map<TAG, boost::shared_ptr<TrapBase>>::iterator trapBaseIt, Coordinates *position);
137 
138  };
139 
140 }
141 
TAG dungeonTag
生成元ダンジョンタグ
Definition: Field.h:41
ゲーム中のアイテムと付随要素のプロトタイプ
std::string TAG
ゲーム要素文字列ID
Definition: Deeangband.h:144
std::vector< boost::shared_ptr< Door > > doors
ドアインスタンスの配列
Definition: Field.h:35
フロアのクラス
Definition: Field.h:30
ゲーム中のダンジョンと付随要素のプロトタイプ
ゲーム中のトラップのプロトタイプ
std::vector< boost::shared_ptr< Creature > > creatures
クリーチャーインスタンスの配列
Definition: Field.h:34
ゲームの諸要素の管理を行うスーパークラス
Definition: GameInstance.h:21
BOOST_CLASS_VERSION(Deeangband::Field, 10)
GameInstanceクラスと付随要素のプロトタイプ
MAP_LENGTH width
フロアの横サイズ
Definition: Field.h:38
friend class boost::serialization::access
Definition: Field.h:43
int DEPTH
階層深度
Definition: Deeangband.h:150
標準のシステム インクルード ファイルのインクルード ファイル、または 参照回数が多く、かつあまり変更さ...
void serialize(Archive &archive, const unsigned int version)
クラスのシリアライズを設定する
Definition: Field.h:51
std::vector< std::vector< boost::shared_ptr< Square > > > squares
フロアマスの配列
Definition: Field.h:33
ゲーム世界のプロトタイプ宣言
int MAP_LENGTH
マップ距離
Definition: Deeangband.h:154
ゲーム中のマスと付随要素のプロトタイプ
ゲーム中のトラップベースのプロトタイプ
bool generated
フロア生成済み
Definition: Field.h:40
ゲーム座標のクラス
Definition: Coordinates.h:32
マスのクラス
Definition: Square.h:24
MAP_LENGTH height
フロアの縦サイズ
Definition: Field.h:39
std::vector< boost::shared_ptr< Item > > items
アイテムインスタンスの配列
Definition: Field.h:37
ゲーム中のトラップのプロトタイプ定義
std::vector< boost::shared_ptr< Trap > > traps
トラップインスタンスの配列
Definition: Field.h:36