File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -37,17 +37,27 @@ impl PrincipleVariation {
3737 Ok ( push_result?)
3838 }
3939
40+ /// Extend the current [PrincipleVariation] with the given move and another principle variation.
41+ ///
42+ /// This will clear the current PV and append the given move and [PrincipleVariation].
43+ ///
44+ /// # Arguments:
45+ ///
46+ /// - m: The new move to add to the principle variation.
47+ /// - pv: The principle variation to append to the current variation.
4048 #[ inline( always) ]
4149 pub ( crate ) fn extend ( & mut self , m : Move , pv : & Self ) -> Result < ( ) > {
4250 self . clear ( ) ;
4351 self . push ( m) ?;
4452 Ok ( self . data . try_extend_from_slice ( pv. data . as_slice ( ) ) ?)
4553 }
4654
55+ /// Clear the principle variation.
4756 pub ( crate ) fn clear ( & mut self ) {
4857 self . data . clear ( ) ;
4958 }
5059
60+ /// Returns an iterator to the underlying data of the [PrincipleVariation].
5161 pub ( crate ) fn iter ( & self ) -> impl Iterator < Item = & Move > {
5262 self . data . iter ( )
5363 }
You can’t perform that action at this time.
0 commit comments