Bazaar developer reference

CvCityBuildings::NotifyNewBuildingStarted(BuildingTypes)

Defined in
CvBuildingClasses.cpp, line 3881
Class
CvCityBuildings
Hook name
CivHooks::CvCityBuildings_NotifyNewBuildingStarted

Hooks

static bool BeforeCvCityBuildings_NotifyNewBuildingStarted(CvCityBuildings* self, BuildingTypes arg0);static void AfterCvCityBuildings_NotifyNewBuildingStarted(CvCityBuildings* self, BuildingTypes arg0);static void ReplaceCvCityBuildings_NotifyNewBuildingStarted(void (*original)(CvCityBuildings*, BuildingTypes), CvCityBuildings* self, BuildingTypes arg0);CivRegisterBefore<CivHooks::CvCityBuildings_NotifyNewBuildingStarted>(host, &BeforeCvCityBuildings_NotifyNewBuildingStarted);CivRegisterAfter<CivHooks::CvCityBuildings_NotifyNewBuildingStarted>(host, &AfterCvCityBuildings_NotifyNewBuildingStarted);CivRegisterReplace<CivHooks::CvCityBuildings_NotifyNewBuildingStarted>(host, &ReplaceCvCityBuildings_NotifyNewBuildingStarted);

Code

3880/// Uses the notification system to send information out when other players need to know a building has been started3881void CvCityBuildings::NotifyNewBuildingStarted(BuildingTypes /*eIndex*/)3882{3883	// JON: Disabling this notification3884	return;38853886	// is this city starting a wonder? If so, send a notification3887	//CvBuildingEntry* buildingEntry = GC.getBuildingInfo(eIndex);3888	//if (isLimitedWonderClass((BuildingClassTypes)(buildingEntry->GetBuildingClassType())) && GetBuildingProductionTimes100(eIndex) == 0)3889	//{3890	//	Localization::String locString;3891	//	Localization::String locSummaryString;38923893	//	for (uint ui = 0; ui < MAX_MAJOR_CIVS; ui++)3894	//	{3895	//		PlayerTypes ePlayer = (PlayerTypes)ui;38963897	//		if (ePlayer == m_pCity->getOwner() || !GET_PLAYER(ePlayer).isAlive())3898	//		{3899	//			continue;3900	//		}39013902	//		int iX = -1;3903	//		int iY = -1;3904	//		int iPlayerID = -1;39053906	//		if (GET_TEAM(m_pCity->getTeam()).isHasMet(GET_PLAYER(ePlayer).getTeam()))3907	//		{3908	//			if (m_pCity->isRevealed(GET_PLAYER(ePlayer).getTeam(), false))3909	//			{3910	//				locString = Localization::Lookup("TXT_KEY_NOTIFICATION_WONDER_STARTED");3911	//				locString << GET_PLAYER(m_pCity->getOwner()).getNameKey() << buildingEntry->GetTextKey() << m_pCity->getNameKey();3912	//			}3913	//			else3914	//			{3915	//				locString = Localization::Lookup("TXT_KEY_NOTIFICATION_WONDER_STARTED_UNKNOWN_LOCATION");3916	//				locString << GET_PLAYER(m_pCity->getOwner()).getNameKey() << buildingEntry->GetTextKey();3917	//			}391839193920	//			locSummaryString = Localization::Lookup("TXT_KEY_NOTIFICATION_SUMMARY_WONDER_STARTED");3921	//			locSummaryString << GET_PLAYER(m_pCity->getOwner()).getNameKey() << buildingEntry->GetTextKey();39223923	//		}3924	//		else3925	//		{3926	//			locString = Localization::Lookup("TXT_KEY_NOTIFICATION_WONDER_STARTED_UNMET");3927	//			locString << buildingEntry->GetTextKey();3928	//			locSummaryString = Localization::Lookup("TXT_KEY_NOTIFICATION_SUMMARY_WONDER_STARTED_UNKNOWN");3929	//			locSummaryString << buildingEntry->GetTextKey();3930	//		}39313932	//		CvNotifications* pNotifications = GET_PLAYER(ePlayer).GetNotifications();3933	//		if (pNotifications)3934	//		{3935	//			pNotifications->Add(NOTIFICATION_WONDER_STARTED, locString.toUTF8(), locSummaryString.toUTF8(), iX, iY, eIndex);3936	//		}3937	//	}3938	//}3939}

Called by