예제 #1
0
int main(int argc) {
  Thing *one = getThing(false);
  Thing *two = getThing(true);

  int x = one->getX() + two->getX();
  assert(x==3);

  delete two;
  delete one;
  
  assert(decon==2);

  return 0;
}
예제 #2
0
int cache_flush(){
	int i = 0;
	
	for( i=0; i<SECTORS; i++ ){
		printf("Sector: %d\n", getThing(i));
	}
	return _cache_flush();
}
예제 #3
0
파일: menu.cpp 프로젝트: johndoe123/scummvm
void Menu::setupMenuObjects() {
    _activeMenuItem.reset();
    for (int i = 0; i < kObjectNum; i++) {
        if (_vm->_objects[i])
            _activeMenuItem.setupOption(getThing(i + 1), getThingChar(i + 1), "", true);
    }
    _activeMenuItem.display();
}
예제 #4
0
파일: tile.cpp 프로젝트: Cadyan/otclient
ItemPtr Tile::getGround()
{
    ThingPtr firstObject = getThing(0);
    if(!firstObject)
        return nullptr;
    if(firstObject->isGround() && firstObject->isItem())
        return firstObject->static_self_cast<Item>();
    return nullptr;
}
예제 #5
0
파일: tile.cpp 프로젝트: Cadyan/otclient
bool Tile::limitsFloorsView(bool isFreeView)
{
    // ground and walls limits the view
    ThingPtr firstThing = getThing(0);

    if(isFreeView) {
        if(firstThing && !firstThing->isDontHide() && (firstThing->isGround() || firstThing->isOnBottom()))
            return true;
    } else if(firstThing && !firstThing->isDontHide() && (firstThing->isGround() || (firstThing->isOnBottom() && firstThing->blockProjectile())))
        return true;
    return false;
}
예제 #6
0
Item* Tile::getUseItem(int32_t index) const
{
	const TileItemVector* items = getItemList();
	if (!items || items->size() == 0) {
		return ground;
	}

	if (Thing* thing = getThing(index)) {
		return thing->getItem();
	}

	return nullptr;
}
예제 #7
0
파일: tile.cpp 프로젝트: Cadyan/otclient
bool Tile::isFullyOpaque()
{
    ThingPtr firstObject = getThing(0);
    return firstObject && firstObject->isFullGround();
}