public void PerformAndStore(Func <IMoveFinders, IMoveFindingStartegy> chooseStrategy) { var strategy = chooseStrategy(_moveFinders); var bestMove = strategy.Search(_fieldsGraph); _movesHistory.PerformAndStore(() => _performMoves, bestMove.Move); }
private void PerformJump(Field newSelectedField, IEnumerable <Field> jumpedFields) { _movesHistory.PerformAndStore(() => _performMoves, new JumpWhiteStoneMove(_selectedField, jumpedFields, newSelectedField)); NextState = new PlayerSelectedFieldStateMove(_phutballBoard, _playersState, newSelectedField, _movesHistory); }
private void SelectField(Field field) { _movesHistory.PerformAndStore(() => _performMoves, new SelectWhiteFieldMove(field)); NextState = new PlayerSelectedFieldStateMove(_phutballBoard, _playersState, field, _movesHistory); }