Mana
Loading...
Searching...
No Matches
flooritem.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2004-2009 The Mana World Development Team
4 * Copyright (C) 2009-2012 The Mana Developers
5 *
6 * This file is part of The Mana Client.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include "actorsprite.h"
25
26class ItemInfo;
27
31class FloorItem final : public ActorSprite
32{
33 public:
42 FloorItem(int id,
43 int itemId,
44 const Vector &position,
45 Map *map);
46
47 Type getType() const override { return FLOOR_ITEM; }
48
49 bool draw(Graphics *graphics, int offsetX, int offsetY) const override;
50
54 int getItemId() const { return mItemId; }
55
60 const ItemInfo &getInfo() const;
61
62 int getTileX() const override { return mX; }
63 int getTileY() const override { return mY; }
64
65 private:
67 int mX, mY;
69};
An item lying on the floor.
Definition flooritem.h:32
int getTileY() const override
Returns the y coordinate in tiles of the actor.
Definition flooritem.h:63
int getItemId() const
Returns the item ID.
Definition flooritem.h:54
int getTileX() const override
Returns the x coordinate in tiles of the actor.
Definition flooritem.h:62
bool draw(Graphics *graphics, int offsetX, int offsetY) const override
Draws the Actor to the given graphics context.
Definition flooritem.cpp:63
const ItemInfo & getInfo() const
Returns the item info for this floor item.
Definition flooritem.cpp:76
ResourceRef< Image > mImage
Definition flooritem.h:68
int mItemId
Definition flooritem.h:66
Type getType() const override
Returns the type of the ActorSprite.
Definition flooritem.h:47
A central point of control for graphics.
Definition graphics.h:78
Defines a class for storing generic item infos.
Definition iteminfo.h:100
A tile map.
Definition map.h:147
Automatically counting Resource reference.
Definition resource.h:74
Vector class.
Definition vector.h:33
Graphics * graphics
Definition client.cpp:104