22#ifndef QDENGINE_QDCORE_QD_INVENTORY_CELL_H
23#define QDENGINE_QDCORE_QD_INVENTORY_CELL_H
25#include "qdengine/parser/xml_fwd.h"
26#include "qdengine/qdcore/qd_sprite.h"
34class qdGameObjectAnimated;
48 void set_type(
int tp) {
53 _sprite.set_file(fname);
56 return _sprite.file();
63 bool load_resources()
const;
64 void free_resources()
const;
69 const Vect2i &size()
const {
70 return _sprite.size();
81 return ((f.type() == s.type()) && (f.sprite() == s.sprite()));
84inline bool operator == (
const qdInventoryCellType &f,
int type) {
85 return f.type() == type;
103 void set_type(
int tp) {
110 void set_sprite(
const qdSprite *spr) {
119 bool is_empty()
const {
120 if (!_object)
return true;
124 const Vect2i &size()
const {
126 return sprite()->size();
133 if (sprite())
return sprite()->size_x();
137 if (sprite())
return sprite()->size_y();
141 void redraw(
int x,
int y,
bool inactive_mode =
false)
const;
143 bool load_resources();
144 bool free_resources();
151 static void set_shadow(uint32 color,
int alpha) {
152 _shadow_color = color;
153 _shadow_alpha = alpha;
169 static uint32 _shadow_color;
170 static int _shadow_alpha;
185 const Vect2s screen_pos()
const {
186 return _screen_pos + g_engine->screen_offset();
188 void set_screen_pos(
const Vect2s &pos) {
194 return _last_screen_region;
198 Vect2s cell_position(
int cell_idx)
const;
200 const Vect2s &size()
const {
203 void set_size(
const Vect2s &sz) {
204 assert(sz.x && sz.y);
209 _cells.
resize((sz.x + _additional_cells.x) * (sz.y + _additional_cells.y));
217 bool hit(
const Vect2s &pos)
const;
220 void pre_redraw()
const;
221 void redraw(
int offs_x = 0,
int offs_y = 0,
bool inactive_mode =
false)
const;
230 bool load_script(
const xml::tag *p);
243 int num_cells()
const {
244 return _cells.
size();
247 bool load_resources();
248 bool free_resources();
250 void objects_quant(
float dt);
252 Vect2s additional_cells()
const {
253 return _additional_cells;
255 void set_additional_cells(Vect2s val) {
256 _additional_cells = val;
267 void debug_log()
const;
271 bool has_rect_objects(
int left,
int top,
int right,
int bottom)
const;
iterator end()
Definition: array.h:380
T & front()
Definition: array.h:218
size_type size() const
Definition: array.h:316
void resize(size_type newSize)
Definition: array.h:412
iterator begin()
Definition: array.h:375
Прямоугольная область на экране.
Definition: gr_screen_region.h:31
Dynamic object.
Definition: qd_game_object_animated.h:37
Ячейка инвентори.
Definition: qd_inventory_cell.h:91
bool load_data(Common::SeekableReadStream &fh, int save_version)
Загрузка данных из сэйва.
bool save_data(Common::WriteStream &fh) const
Запись данных в сэйв.
Группа ячеек инвентори.
Definition: qd_inventory_cell.h:176
void scroll_left()
Скроллинг
bool load_data(Common::SeekableReadStream &fh, int save_version)
Загрузка данных из сэйва.
bool save_data(Common::WriteStream &fh) const
Запись данных в сэйв.
Описание ячейки инвентори.
Definition: qd_inventory_cell.h:37
Спрайт.
Definition: qd_sprite.h:39
XML тег.
Definition: xml_tag.h:33
signed char * fill(signed char *first, signed char *last, Value val)
Definition: algorithm.h:168
Definition: algorithm.h:29
Базовый класс для игровых ресурсов.
Definition: console.h:28