File indexing completed on 2025-03-09 03:49:44

0001 /*
0002     SPDX-FileCopyrightText: 1998 Anders Widell <d95-awi@nada.kth.se>
0003     SPDX-FileCopyrightText: 2022 Friedrich W. H. Kossebau <kossebau@kde.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef STONEINDEX_H
0009 #define STONEINDEX_H
0010 
0011 #include <QVector>
0012 
0013 class StoneIndex
0014 {
0015 public:
0016     StoneIndex();
0017 
0018 public:
0019     void setStoneCount(int largeStoneCount, int smallStoneCount);
0020 
0021     int upperLarge(int index) const;
0022     int lowerLarge(int index) const;
0023     int leftSmall(int index) const;
0024     int rightSmall(int index) const;
0025 
0026 private:
0027     void expandIndex(int size) const;
0028 
0029 private:
0030     int m_largeStoneCount = 0;
0031     int m_smallStoneCount = 0;
0032 
0033     mutable int m_indexSize = 0;
0034     mutable QVector<uchar> m_upperLargeIndex;
0035     mutable QVector<uchar> m_lowerLargeIndex;
0036     mutable QVector<uchar> m_leftSmallIndex;
0037     mutable QVector<uchar> m_rightSmallIndex;
0038 };
0039 
0040 #endif