refactore to new project structure
This commit is contained in:
+10
-7
@@ -1,30 +1,33 @@
|
||||
package logic
|
||||
|
||||
import "git.kleiax.de/homepage/libs/sudoku/board"
|
||||
import (
|
||||
"git.kleiax.de/homepage/board"
|
||||
"git.kleiax.de/homepage/logic/strategies"
|
||||
)
|
||||
|
||||
// ────────────────────────────────────────────────────────────────────────────── //
|
||||
// SOLVER STRUCTURE //
|
||||
// ────────────────────────────────────────────────────────────────────────────── //
|
||||
|
||||
type Solver struct {
|
||||
strategies []Strategy
|
||||
strategies []strategies.Strategy
|
||||
conf struct {
|
||||
all bool
|
||||
repeat bool
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Solver) Add(strategy Strategy) {
|
||||
func (s *Solver) Add(strategy strategies.Strategy) {
|
||||
s.strategies = append(s.strategies, strategy)
|
||||
}
|
||||
|
||||
func (s *Solver) initStragies(field *board.Field) {
|
||||
func (s *Solver) InitStragies(field *board.Field) {
|
||||
for _, strategy := range s.strategies {
|
||||
strategy.Init(field)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Solver) run(i int) bool {
|
||||
func (s *Solver) Run(i int) bool {
|
||||
//TODO: clean und Fehlerauffangen
|
||||
s.strategies[i].SearchProgressableCells()
|
||||
numberOfChanges := s.strategies[i].ApplyAll()
|
||||
@@ -34,10 +37,10 @@ func (s *Solver) run(i int) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (s *Solver) search() {
|
||||
func (s *Solver) Search() {
|
||||
|
||||
}
|
||||
|
||||
func (s *Solver) getSolutionPath() []board.Change {
|
||||
func (s *Solver) GetSolutionPath() []board.ExternalChange {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user