File indexing completed on 2021-12-21 12:50:21
0001 /* 0002 * ksokoban - a Sokoban game by KDE 0003 * Copyright (C) 1998-2000 Anders Widell <awl@hem.passagen.se> 0004 * 0005 * This program is free software; you can redistribute it and/or modify 0006 * it under the terms of the GNU General Public License as published by 0007 * the Free Software Foundation; either version 2 of the License, or 0008 * (at your option) any later version. 0009 * 0010 * This program is distributed in the hope that it will be useful, 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0013 * GNU General Public License for more details. 0014 * 0015 * You should have received a copy of the GNU General Public License 0016 * along with this program; if not, write to the Free Software 0017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 0018 */ 0019 0020 #ifndef INTERNALCOLLECTIONS_H 0021 #define INTERNALCOLLECTIONS_H 0022 0023 #include <assert.h> 0024 #include <QString> 0025 #include <QVector> 0026 0027 #include "LevelCollection.h" 0028 0029 class InternalCollections { 0030 public: 0031 InternalCollections(); 0032 ~InternalCollections(); 0033 0034 static int toInternalId(int _id) { 0035 if (_id < 10 || _id > 14) return 1000; 0036 return _id - 10; 0037 } 0038 0039 int collections(); 0040 LevelCollection *operator[](int n); 0041 0042 private: 0043 void add(LevelCollection* c); 0044 0045 static int configCollection2Real(int collection); 0046 static int realCollection2Config(int collection); 0047 static QString collectionName(int _level); 0048 0049 QVector<LevelCollection*> collections_; 0050 char *data_; 0051 0052 }; 0053 0054 #endif /* INTERNALCOLLECTIONS_H */