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 OBJECT_H 0013 #define OBJECT_H 0014 0015 #include <QString> 0016 0017 namespace ObjectType { 0018 enum Type { 0019 Object, 0020 Item, 0021 SnakePart, 0022 Obstacle 0023 }; 0024 } 0025 0026 /** 0027 * @short This class represents a drawable object on the playfield 0028 */ 0029 class Object 0030 { 0031 public: 0032 Object(); 0033 explicit Object(ObjectType::Type t); 0034 int getX() const; 0035 int getY() const; 0036 void setCoordinates(int x, int y); 0037 QString getSVGName() const; 0038 ObjectType::Type getObjectType() const; 0039 0040 private: 0041 int m_xCoordinate; 0042 int m_yCoordinate; 0043 QString m_svgName; 0044 ObjectType::Type m_objectType; 0045 0046 protected: 0047 void setSVGName(const QString &svgName); 0048 }; 0049 0050 #endif // OBJECT_H