Style cleanup.

This commit is contained in:
Axel Dörfler 2012-05-16 01:06:26 +02:00
parent 0e8316cc90
commit 3a1a1e1b82

View File

@ -1,5 +1,5 @@
/*
* Copyright 2007-2010, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2007-2012, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*/
#ifndef SUDOKU_FIELD_H
@ -17,39 +17,42 @@ enum {
class SudokuField : public BArchivable {
public:
SudokuField(uint32 size);
SudokuField(const BMessage* archive);
SudokuField(const SudokuField& other);
virtual ~SudokuField();
SudokuField(uint32 size);
SudokuField(const BMessage* archive);
SudokuField(const SudokuField& other);
virtual ~SudokuField();
status_t InitCheck();
status_t InitCheck();
virtual status_t Archive(BMessage* archive, bool deep) const;
static SudokuField* Instantiate(BMessage* archive);
virtual status_t Archive(BMessage* archive, bool deep) const;
static SudokuField* Instantiate(BMessage* archive);
status_t SetTo(char base, const char* data);
void SetTo(const SudokuField* other);
void Reset();
status_t SetTo(char base, const char* data);
void SetTo(const SudokuField* other);
void Reset();
bool IsSolved() const;
bool IsEmpty() const;
bool IsSolved() const;
bool IsEmpty() const;
uint32 Size() const { return fSize; }
uint32 BlockSize() const { return fBlockSize; }
uint32 Size() const { return fSize; }
uint32 BlockSize() const { return fBlockSize; }
void SetHintMaskAt(uint32 x, uint32 y, uint32 hintMask);
uint32 HintMaskAt(uint32 x, uint32 y) const;
void SetHintMaskAt(uint32 x, uint32 y,
uint32 hintMask);
uint32 HintMaskAt(uint32 x, uint32 y) const;
void SetValidMaskAt(uint32 x, uint32 y, uint32 validMask);
uint32 ValidMaskAt(uint32 x, uint32 y) const;
void SetValidMaskAt(uint32 x, uint32 y,
uint32 validMask);
uint32 ValidMaskAt(uint32 x, uint32 y) const;
void SetFlagsAt(uint32 x, uint32 y, uint32 flags);
uint32 FlagsAt(uint32 x, uint32 y) const;
void SetFlagsAt(uint32 x, uint32 y, uint32 flags);
uint32 FlagsAt(uint32 x, uint32 y) const;
void SetValueAt(uint32 x, uint32 y, uint32 value, bool setSolved = false);
uint32 ValueAt(uint32 x, uint32 y) const;
void SetValueAt(uint32 x, uint32 y, uint32 value,
bool setSolved = false);
uint32 ValueAt(uint32 x, uint32 y) const;
void Dump();
void Dump();
private:
struct field {
@ -61,16 +64,19 @@ private:
uint32 value;
};
bool _ValidValueAt(uint32 x, uint32 y) const;
void _ComputeValidMask(uint32 x, uint32 y, bool setSolved);
void _UpdateValidMaskChanged(uint32 x, uint32 y, bool setSolved);
const field& _FieldAt(uint32 x, uint32 y) const;
field& _FieldAt(uint32 x, uint32 y);
bool _ValidValueAt(uint32 x, uint32 y) const;
void _ComputeValidMask(uint32 x, uint32 y,
bool setSolved);
void _UpdateValidMaskChanged(uint32 x, uint32 y,
bool setSolved);
const field& _FieldAt(uint32 x, uint32 y) const;
field& _FieldAt(uint32 x, uint32 y);
uint32 fSize;
uint32 fBlockSize;
uint32 fMaxMask;
field* fFields;
private:
uint32 fSize;
uint32 fBlockSize;
uint32 fMaxMask;
field* fFields;
};