Пример #1
0
void House::updateDoorDescription()
{
  std::stringstream houseDescription;
  houseDescription << "It belongs to house '" << houseName << "'. " << std::endl;

  if(houseOwner != 0){
    houseDescription << houseOwnerName << " owns this house.";
  }
  else{
    houseDescription << "Nobody owns this house.";
    if(g_config.getNumber(ConfigManager::SHOW_HOUSE_PRICES)){
      uint32_t price = getTileCount() * g_config.getNumber(ConfigManager::HOUSE_TILE_PRICE);
      houseDescription << std::endl << "It costs " << price << " gold coins.";
      std::string strPeriod;
      Houses::getInstance()->getRentPeriodString(strPeriod);
      if(strPeriod != "never"){
        houseDescription << " Its rent costs " << getRent() << " gold coins and it's paid " << strPeriod << ".";
      }
    }
  }

  HouseDoorList::iterator it;
  for(it = doorList.begin(); it != doorList.end(); ++it){
    (*it)->setSpecialDescription(houseDescription.str());
  }
}
Пример #2
0
void House::save(TiXmlElement* elem)
{
    elem->SetAttribute("name", getName());
    elem->SetAttribute("houseid", getId());

    Position entry = getEntry();
    elem->SetAttribute("entryx", entry.x);
    elem->SetAttribute("entryy", entry.y);
    elem->SetAttribute("entryz", entry.z);

    elem->SetAttribute("rent", getRent());
    elem->SetAttribute("townid", getTownId());
    elem->SetAttribute("size", getSize());
    elem->SetAttribute("guildhall", (int)m_isGuildHall);
}