All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Private Attributes | Friends | List of all members
osl::search::ThreatmateState Class Reference

詰めろを考慮した詰将棋探索のための状態管理. More...

#include <threatmateState.h>

Inheritance diagram for osl::search::ThreatmateState:
Inheritance graph
[legend]
Collaboration diagram for osl::search::ThreatmateState:
Collaboration graph
[legend]

Public Types

enum  Status {
  UNKNOWN = 0, THREATMATE, MAYBE_THREATMATE, CHECK_AFTER_THREATMATE,
  MAY_HAVE_CHECKMATE
}
 

Public Member Functions

 ThreatmateState (Status s=UNKNOWN)
 
void setThreatmate (Status s)
 
bool isUnknown () const
 
bool isThreatmate () const
 
bool maybeThreatmate () const
 
bool mayHaveCheckmate () const
 
Status status () const
 
const ThreatmateState newStatus (bool is_check) const
 
void update (const ThreatmateState *parent, bool in_check)
 

Static Private Attributes

static const CArray< Status, 5 *2 > transition
 

Friends

class DualThreatmateState
 

Additional Inherited Members

- Protected Attributes inherited from osl::search::ThreatmateStateData
char current_status
 

Detailed Description

詰めろを考慮した詰将棋探索のための状態管理.

http://www31.ocn.ne.jp/~kfend/inside_kfend/ptc.html#c3

Definition at line 29 of file threatmateState.h.

Member Enumeration Documentation

Enumerator
UNKNOWN 
THREATMATE 

threatmate found by checkmate search

MAYBE_THREATMATE 

threatmate, not sure

CHECK_AFTER_THREATMATE 

status after threatmate responded by check

MAY_HAVE_CHECKMATE 

status after threatmate responded by non-check move

Definition at line 33 of file threatmateState.h.

Constructor & Destructor Documentation

osl::search::ThreatmateState::ThreatmateState ( Status  s = UNKNOWN)
inline

Member Function Documentation

bool osl::search::ThreatmateState::isThreatmate ( ) const
inline
bool osl::search::ThreatmateState::isUnknown ( ) const
inline

Definition at line 54 of file threatmateState.h.

References osl::search::ThreatmateStateData::current_status, and UNKNOWN.

bool osl::search::ThreatmateState::maybeThreatmate ( ) const
inline
bool osl::search::ThreatmateState::mayHaveCheckmate ( ) const
inline
const ThreatmateState osl::search::ThreatmateState::newStatus ( bool  is_check) const
inline

Definition at line 70 of file threatmateState.h.

References osl::search::ThreatmateStateData::current_status, and transition.

Referenced by update().

void osl::search::ThreatmateState::setThreatmate ( Status  s)
inline
Status osl::search::ThreatmateState::status ( ) const
inline
void osl::search::ThreatmateState::update ( const ThreatmateState parent,
bool  in_check 
)
inline

Definition at line 75 of file threatmateState.h.

References maybeThreatmate(), and newStatus().

Referenced by osl::search::DualThreatmateState::updateInLock().

Friends And Related Function Documentation

friend class DualThreatmateState
friend

Definition at line 31 of file threatmateState.h.

Member Data Documentation

const osl::CArray< osl::search::ThreatmateState::Status, 5 *2 > osl::search::ThreatmateState::transition
staticprivate

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