2 * Copyright 2007-2012, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
9 #include <Archivable.h>
10 #include <SupportDefs.h>
18 class SudokuField
: public BArchivable
{
20 SudokuField(uint32 size
);
21 SudokuField(const BMessage
* archive
);
22 SudokuField(const SudokuField
& other
);
23 virtual ~SudokuField();
27 virtual status_t
Archive(BMessage
* archive
, bool deep
) const;
28 static SudokuField
* Instantiate(BMessage
* archive
);
30 status_t
SetTo(char base
, const char* data
);
31 void SetTo(const SudokuField
* other
);
34 bool IsSolved() const;
36 bool IsValueCompleted(uint32 value
) const;
38 uint32
Size() const { return fSize
; }
39 uint32
BlockSize() const { return fBlockSize
; }
41 void SetHintMaskAt(uint32 x
, uint32 y
,
43 uint32
HintMaskAt(uint32 x
, uint32 y
) const;
44 bool HasHint(uint32 x
, uint32 y
, uint32 value
) const;
46 void SetValidMaskAt(uint32 x
, uint32 y
,
48 uint32
ValidMaskAt(uint32 x
, uint32 y
) const;
49 bool IsValid(uint32 x
, uint32 y
, uint32 value
) const;
51 void SetFlagsAt(uint32 x
, uint32 y
, uint32 flags
);
52 uint32
FlagsAt(uint32 x
, uint32 y
) const;
53 bool IsInitialValue(uint32 x
, uint32 y
) const;
55 void SetValueAt(uint32 x
, uint32 y
, uint32 value
,
56 bool setSolved
= false);
57 uint32
ValueAt(uint32 x
, uint32 y
) const;
71 bool _ValidValueAt(uint32 x
, uint32 y
) const;
72 void _ComputeValidMask(uint32 x
, uint32 y
,
74 void _UpdateValidMaskChanged(uint32 x
, uint32 y
,
76 const field
& _FieldAt(uint32 x
, uint32 y
) const;
77 field
& _FieldAt(uint32 x
, uint32 y
);
87 #endif // SUDOKU_FIELD_H