File indexing completed on 2024-04-28 04:04:39

0001 /*
0002     This file is part of the game 'KTron'
0003 
0004     SPDX-FileCopyrightText: 1998-2000 Matthias Kiefer <matthias.kiefer@gmx.de>
0005     SPDX-FileCopyrightText: 2005 Benjamin C. Meyer <ben at meyerhome dot net>
0006     SPDX-FileCopyrightText: 2008-2009 Stas Verberkt <legolas at legolasweb dot nl>
0007 
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 
0010 */
0011 
0012 #ifndef PLAYFIELD_H
0013 #define PLAYFIELD_H
0014 
0015 #include "object.h"
0016 
0017 #include <QList>
0018 
0019 #define TRON_PLAYFIELD_WIDTH 50
0020 #define TRON_PLAYFIELD_HEIGHT 30
0021 
0022 /**
0023 * @short This class represents the playfield
0024 */
0025 class PlayField
0026 {
0027     public:
0028         PlayField();
0029         void initialize();
0030         
0031         Object *getObjectAt(int x, int y);
0032         int getWidth();
0033         int getHeight();
0034         
0035         void setObjectAt(int x, int y, Object &o);
0036         
0037     private:
0038         QList< Object > m_playfield;
0039         int m_width;
0040         int m_height;
0041 };
0042 
0043 #endif // PLAYFIELD_H