本文整理汇总了C++中Obj::is_readied方法的典型用法代码示例。如果您正苦于以下问题:C++ Obj::is_readied方法的具体用法?C++ Obj::is_readied怎么用?C++ Obj::is_readied使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj
的用法示例。
在下文中一共展示了Obj::is_readied方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Obj *InventoryWidget::get_obj_at_location(int x, int y)
{
uint8 location;
U6LList *inventory;
U6Link *link;
Obj *obj = NULL;
uint16 i;
if(x >= objlist_offset_x && y >= objlist_offset_y)
{
location = get_list_position(x,y); //find the postion of the object we hit in the inventory
if(container_obj)
inventory = container_obj->container;
else
inventory = actor->get_inventory_list();
if(inventory == NULL)
link = NULL;
else
link = inventory->start();
for(i=0;link != NULL && i <= location;link=link->next)
{
obj = (Obj *)link->data;
if(obj->is_readied() == false)
i++;
}
if(i > location && obj && obj->is_readied() == false) // don't return readied or non existent objects
return obj;
}
return NULL;
}
示例2: drag_perform_drop
void InventoryWidget::drag_perform_drop(int x, int y, int message, void *data)
{
DEBUG(0,LEVEL_DEBUGGING,"InventoryWidget::drag_perform_drop()\n");
Obj *obj;
x -= area.x;
y -= area.y;
if(message == GUI_DRAG_OBJ)
{
DEBUG(0,LEVEL_DEBUGGING,"Drop into inventory.\n");
obj = (Obj *)data;
if(target_obj && obj_manager->can_store_obj(target_obj, obj))
{
obj_manager->moveto_container(obj, target_obj);
}
else if(target_cont && obj_manager->can_store_obj(target_cont, obj))
{
obj_manager->moveto_container(obj, target_cont);
}
else
{
if(obj->is_readied())
Game::get_game()->get_event()->unready(obj);
else
obj_manager->moveto_inventory(obj, actor);
}
Redraw();
}
Game::get_game()->get_map_window()->updateBlacking();
target_obj = NULL;
return;
}
示例3: display_inventory_list
void InventoryWidget::display_inventory_list()
{
const Tile *tile;
U6LList *inventory;
U6Link *link;
Obj *obj = NULL;
uint16 i,j;
uint16 skip_num;
int max_rows = 4;
if(Game::get_game()->get_game_type() == NUVIE_GAME_U6)
max_rows = 3;
if(container_obj)
inventory = container_obj->container;
else
inventory = actor->get_inventory_list();
if(inventory == NULL)
link = NULL;
else
link = inventory->start();
//skip row_offset rows of objects.
skip_num = row_offset * 4;
for(i=0;link != NULL && i < skip_num; link = link->next)
{
obj = (Obj *)link->data;
if(obj->is_readied() == false)
i++;
}
for(i=0;i<max_rows;i++)
{
for(j=0;j<4;j++)
{
if(link != NULL)
{
obj = (Obj *)link->data;
if(obj->is_readied()) //skip any readied objects
{
for(;link != NULL && obj->is_readied(); link = link->next)
obj = (Obj *)link->data;
}
else
link = link->next;
tile = tile_manager->get_tile(obj_manager->get_obj_tile_num(obj)+obj->frame_n);
if(link == NULL)
{
if(obj->is_readied()) //last object is readied so skip it.
tile = empty_tile;
}
}
else
tile = empty_tile;
//tile = tile_manager->get_tile(actor->indentory_tile());
if(tile == empty_tile)
screen->blit((area.x+objlist_offset_x)+j*16,area.y+objlist_offset_y+i*16,(unsigned char *)empty_tile->data,8,16,16,16,true);
if(tile != empty_tile)
{
//draw qty string for stackable items
if(obj_manager->is_stackable(obj))
display_qty_string((area.x+objlist_offset_x)+j*16,area.y+objlist_offset_y+i*16,obj->qty);
//draw special char for Keys.
if(game_type == NUVIE_GAME_U6 && obj->obj_n == 64)
display_special_char((area.x+objlist_offset_x)+j*16,area.y+objlist_offset_y+i*16,obj->quality);
}
screen->blit((area.x+objlist_offset_x)+j*16,area.y+objlist_offset_y+i*16,(unsigned char *)tile->data,8,16,16,16,true);
}
}
}