예제 #1
0
 private PegBoard(IPegBoardSource pegBoardSource)
 {
     Columns      = pegBoardSource.Columns * 2 - 1;
     Rows         = pegBoardSource.Rows;
     Goal         = pegBoardSource.Goal;
     MissingPegs  = pegBoardSource.MissingPegs;
     GoalPeg      = Peg.Create(pegBoardSource.Rows, pegBoardSource.Goal * 2 + 1);
     _pegsFactory = new Peg.Factory(Rows, Columns, MissingPegs);
 }
예제 #2
0
 public static PegBoard FromSource(IPegBoardSource pegBoardSource)
 {
     return(new PegBoard(pegBoardSource));
 }