@@ -110,10 +110,12 @@ private List<Move> GeneratePossibleMoves(List<Action> pastActions = null, Ship c
110
110
{
111
111
var newCurShip = ( Ship ) curShip . Clone ( ) ;
112
112
var newOtherShip = ( Ship ) otherShip . Clone ( ) ;
113
+ var newActions = pastActions . Clone ( ) ;
114
+ newActions . Add ( newAction ) ;
113
115
newAction . PerformOn ( this , newCurShip , newOtherShip ) ;
114
116
115
117
// You're on a path in the woods, and at the end of that path is a cabin...
116
- re . AddRange ( GeneratePossibleMoves ( new List < Action > { newAction } , newCurShip , newOtherShip ) ) ;
118
+ re . AddRange ( GeneratePossibleMoves ( newActions , newCurShip , newOtherShip ) ) ;
117
119
}
118
120
}
119
121
}
@@ -129,10 +131,12 @@ private List<Move> GeneratePossibleMoves(List<Action> pastActions = null, Ship c
129
131
{
130
132
var newCurShip = ( Ship ) curShip . Clone ( ) ;
131
133
var newOtherShip = ( Ship ) otherShip . Clone ( ) ;
134
+ var newActions = pastActions . Clone ( ) ;
135
+ newActions . Add ( newAction ) ;
132
136
newAction . PerformOn ( this , newCurShip , newOtherShip ) ;
133
137
134
138
// You're on a path in the woods, and at the end of that path is a cabin...
135
- re . AddRange ( GeneratePossibleMoves ( new List < Action > { newAction } , newCurShip , newOtherShip ) ) ;
139
+ re . AddRange ( GeneratePossibleMoves ( newActions , newCurShip , newOtherShip ) ) ;
136
140
}
137
141
}
138
142
}
0 commit comments