void DataClassManager::BuildDependencyList(std::list<DataClass*>& dependencies)
{
   //default dependency order based on kind
   //data class can always explicitly specify their dependencies of any kind and that will be honored

   m_objectMutex.lock();
   BuildDependencyList(dependencies, DATA_CLASS_KIND_DEVICE);
   BuildDependencyList(dependencies, DATA_CLASS_KIND_PROCESSOR);
   BuildDependencyList(dependencies, DATA_CLASS_KIND_SOURCE);
   BuildDependencyList(dependencies, DATA_CLASS_KIND_DISPLAY);
   m_objectMutex.unlock();
}
Esempio n. 2
0
void UAblAbility::OnReferencedTaskPropertyModified(UAblAbilityTask& Task, struct FPropertyChangedEvent& PropertyChangedEvent)
{
	if (PropertyChangedEvent.Property && PropertyChangedEvent.Property->GetFName() == FName(TEXT("m_Dependencies")))
	{
		// Our Task changed dependencies. Validate/Rebuild.
		ValidateDependencies();
		BuildDependencyList();
	}

	if (!m_AbilityNameHash)
	{
		m_AbilityNameHash = FCrc::StrCrc32(*GetName());
	}
}
Esempio n. 3
0
void UAblAbility::PostLoad()
{
	Super::PostLoad();

	// This is here just incase you have an Ability that is all Server or all Client tasks. 
	// By calculating the Ability realm using that data, we can skip instantiating the Ability on a realm that doesn't care about it.
	//uint8 AbilityRealm = 0U;
	//for (const UAblAbilityTask* Task : m_Tasks)
	//{
	//	AbilityRealm |= 1 << (uint8)Task->GetTaskRealm();
	//}

	//bool HasClientAndServer = (AbilityRealm & 1 << (uint8)EAblAbilityTaskRealm::ClientAndServer) != 0;
	//bool HasClient = (AbilityRealm & 1 << (uint8)EAblAbilityTaskRealm::Client) != 0;
	//bool HasServer = (AbilityRealm & 1 << (uint8)EAblAbilityTaskRealm::Server) != 0;

	//if (HasClientAndServer || (HasClient && HasServer))
	//{
	//	m_AbilityRealm = EAblAbilityTaskRealm::ClientAndServer;
	//}
	//else if (HasClient && !HasServer)
	//{
	//	m_AbilityRealm = EAblAbilityTaskRealm::Client;
	//}
	//else if (HasServer && !HasClient)
	//{
	//	m_AbilityRealm = EAblAbilityTaskRealm::Server;
	//}

	BuildDependencyList();


#if WITH_EDITORONLY_DATA
	for (UAblAbilityTask* ReferencedTask : m_Tasks)
	{
		// Listen for any property changes on our Tasks. 
		ReferencedTask->GetOnTaskPropertyModified().AddUObject(this, &UAblAbility::OnReferencedTaskPropertyModified);
	}
#endif

	// Generate our Name hash.
	m_AbilityNameHash = FCrc::StrCrc32(*GetName());
}
Esempio n. 4
0
void UAblAbility::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent)
{
	// Loop End can never be past our length.
	m_LoopEnd = FMath::Min(m_LoopEnd, m_Length);

	// Passive has priority over Channeled, so if they set the Ability to passive - revert the channeled property.
	if (m_IsPassive)
	{
		m_IsChanneled = false;
	}

	if (PropertyChangedEvent.Property && PropertyChangedEvent.Property->GetFName() == GET_MEMBER_NAME_CHECKED(UAblAbility, m_Tasks))
	{
		// Our Tasks have changed, rebuild dependencies.
		ValidateDependencies();
		BuildDependencyList();
	}

	if (!m_AbilityNameHash)
	{
		m_AbilityNameHash = FCrc::StrCrc32(*GetName());
	}

}