/// <summary> /// オブジェクトの妥当性を検証します。 /// </summary> public bool Validate() { if (StartBoard == null || !StartBoard.Validate()) { return(false); } if (AutoPlayType == AutoPlayType.Normal) { if (this.moveList == null) { return(false); } return(StartBoard.CanMoveList(this.moveList)); } return(true); }
/// <summary> /// 棋譜の確認と指し手の正規化を行います。 /// </summary> public void Validate() { if (Header == null) { throw new ShogiException( "ヘッダーが設定されていません。"); } if (RootNode == null) { throw new ShogiException( "指し手が設定されていません。"); } if (StartBoard == null || !StartBoard.Validate()) { throw new ShogiException( "開始局面が正しくありません。"); } }