| 1 |
/* defenseSimulation.h |
| 2 |
*/ |
| 3 |
#ifndef _DEFENSE_SIMULATION_H |
| 4 |
#define _DEFENSE_SIMULATION_H |
| 5 |
|
| 6 |
#include "osl/state/numEffectState.h" |
| 7 |
|
| 8 |
namespace osl |
| 9 |
{ |
| 10 |
class PathEncoding; |
| 11 |
namespace checkmate |
| 12 |
{ |
| 13 |
class CheckHashRecord; |
| 14 |
class CheckMove; |
| 15 |
/** |
| 16 |
* @param P 攻撃側 |
| 17 |
*/ |
| 18 |
template <Player P> |
| 19 |
struct DefenseSimulation |
| 20 |
{ |
| 21 |
/** |
| 22 |
* oracle で反証された時に,drop で oracle.move.ptype() が同じ兄弟が |
| 23 |
* 反証できるかどうかをシミュレーションする. |
| 24 |
* @param key state のkey |
| 25 |
* @param path state のpath |
| 26 |
*/ |
| 27 |
template <class Table> |
| 28 |
static void disproofDropSibling(NumEffectState& state, |
| 29 |
const HashKey& key, |
| 30 |
const PathEncoding& path, |
| 31 |
CheckHashRecord *record, Table& table, |
| 32 |
const CheckMove& oracle, |
| 33 |
size_t& node_count); |
| 34 |
/** |
| 35 |
* NoPromote 用: |
| 36 |
* target を指した後,guide と同様に反証できるかどうかを確かめる |
| 37 |
* @param state target を指す前 |
| 38 |
* @param new_key target を指した後 |
| 39 |
* @param new_path target を指した後 |
| 40 |
*/ |
| 41 |
template <class Table> |
| 42 |
static bool disproofNoPromote(NumEffectState& state, |
| 43 |
const HashKey& new_key, |
| 44 |
const PathEncoding& new_path, |
| 45 |
CheckHashRecord *record, Table& table, |
| 46 |
CheckMove& target, |
| 47 |
const CheckMove& guide, size_t& node_count); |
| 48 |
private: |
| 49 |
/** |
| 50 |
* target を指した後,guide と同様に反証できるかどうかを確かめる |
| 51 |
*/ |
| 52 |
template <class Table> |
| 53 |
static bool disproof(NumEffectState& state, |
| 54 |
const HashKey& new_key, |
| 55 |
const PathEncoding& new_path, |
| 56 |
Table& table, const CheckMove& target, |
| 57 |
CheckHashRecord *guide, size_t& node_count); |
| 58 |
|
| 59 |
}; |
| 60 |
} // namespace checkmate |
| 61 |
} // namespace osl |
| 62 |
|
| 63 |
#endif /* _DEFENSE_SIMULATION_H */ |
| 64 |
// ;;; Local Variables: |
| 65 |
// ;;; mode:c++ |
| 66 |
// ;;; c-basic-offset:2 |
| 67 |
// ;;; End: |