void ChangeResolutionAction::Perform(class ArtifactSet &artifacts, class ProgressListener &listener)
	{
		TimeFrequencyData oldContaminated = artifacts.ContaminatedData();

		if(_timeDecreaseFactor != 1)
		{
			ArtifactSet artifactsCopy(artifacts);
			artifactsCopy.SetNoImageSet();
	
			DecreaseTime(artifactsCopy.OriginalData());
			DecreaseTime(artifactsCopy.ContaminatedData());
			DecreaseTime(artifactsCopy.RevisedData());
	
			PerformFrequencyChange(artifactsCopy, listener);
	
			IncreaseTime(artifacts.OriginalData(), artifactsCopy.OriginalData(), false, false);
			IncreaseTime(artifacts.ContaminatedData(), artifactsCopy.ContaminatedData(), _restoreContaminated, _restoreMasks);
			IncreaseTime(artifacts.RevisedData(), artifactsCopy.RevisedData(), _restoreRevised, _restoreMasks);
		} else {
			PerformFrequencyChange(artifacts, listener);
		}
		if(_restoreRevised && !_restoreContaminated)
		{
			oldContaminated.Subtract(artifacts.RevisedData());
			if(_restoreMasks)
				oldContaminated.SetMask(artifacts.ContaminatedData());
			artifacts.SetContaminatedData(oldContaminated);
		}
	}
	void ChangeResolutionAction::Perform(class ArtifactSet &artifacts, class ProgressListener &listener)
	{
		if(_timeDecreaseFactor != 1)
		{
			ArtifactSet artifactsCopy(artifacts);
			artifactsCopy.SetNoImageSet();
	
			TimeFrequencyData oldContaminated = artifacts.ContaminatedData();

			DecreaseTime(artifactsCopy.OriginalData());
			DecreaseTime(artifactsCopy.ContaminatedData());
			DecreaseTime(artifactsCopy.RevisedData());
	
			PerformFrequencyChange(artifactsCopy, listener);
	
			IncreaseTime(artifacts.OriginalData(), artifactsCopy.OriginalData(), false, false);
			IncreaseTime(artifacts.ContaminatedData(), artifactsCopy.ContaminatedData(), _restoreContaminated, _restoreMasks);
			IncreaseTime(artifacts.RevisedData(), artifactsCopy.RevisedData(), _restoreRevised, _restoreMasks);

			if(_restoreRevised && !_restoreContaminated)
			{
				//TimeFrequencyData *contaminatedData =
				//	TimeFrequencyData::CreateTFDataFromDiff(oldContaminated, artifacts.RevisedData());
				//contaminatedData->SetMask(oldContaminated);
				//artifacts.SetContaminatedData(*contaminatedData);
				//delete contaminatedData;
				
				oldContaminated.Subtract(artifacts.RevisedData());
				artifacts.SetContaminatedData(oldContaminated);
			}
		} else {
			PerformFrequencyChange(artifacts, listener);
		}
	}
Exemple #3
0
void CDDom::Process( void )
{
	if( GetRunTime() == RUN_CLOSED )
		return;

	if( GetRunTime() == RUN_COOLDOWN )
	{
		if( m_dwRoundTime != 0 && m_dwRoundTime < GetTickCount() )
		{
			m_dwRoundTime = 0;
			StartRound();
		}
	}
	else if( GetRunTime() == RUN_FIGHT )
	{
		if( GetTime() > 0 )
		{
			DecreaseTime();
		}
		else
		{
			const DDOM_TEAM tA = m_Base[BASE_A].GetTouchTeam();
			const DDOM_TEAM tB = m_Base[BASE_B].GetTouchTeam();
			if( tA != MAX_TEAM && tB != MAX_TEAM )
			{
				if( tA == tB )
				{
					Capped( tA ); //ATTENTION
					ResetCapTeam(); 
				} 
			}	
		}
	}
}
Exemple #4
0
void CArena::Process( void )
{
	if( GetTime() > 0 )
	{
		DecreaseTime();
	}
	else if( GetTime() == 0 )
	{
		SaveToDatabase();
		ResetTime();
	}
}