Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UnrealScriptTest.Test0024_DelegateComparison


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
/**
 * Demonstrates and verifies boolean comparison functionality for delegates.
 *
 * Copyright 2007 Epic Games, Inc. All Rights Reserved
 */
class Test0024_DelegateComparison extends TestClassBase;

var Test0024_Commandlet CommandletOwner;

delegate ComparisonDelegate( int Param1 )
{
	LogInternal("Executing the default body for ComparisonDelegate");
}

function TestDelegateParam( delegate<ComparisonDelegate> MyDelegate )
{
	LogInternal("Here we are in TestDelegateParm");

	if ( MyDelegate != None )
	{
		LogInternal("MyDelegate has a value");
	}

	if ( ComparisonDelegate != None )
	{
		LogInternal("ComparisonDelegate is assigned a value!");
	}

	if ( MyDelegate == ComparisonDelegate )
	{
		LogInternal("MyDelegate value is same as ComparisonDelegate");
	}
	else if ( MyDelegate == DelegateFunction )
	{
		LogInternal("MyDelegate assigned to DelegateFunction");
	}
//	else if ( MyDelegate == SomeOtherDelegate )
//	{
//		`log("This should be a compiler error");
//	}

	if ( MyDelegate == CommandletOwner.CommandletDelegateFunction )
	{
		LogInternal("MyDelegate is assigned to CommandletOwner's CommandletDelegateFunction");
	}

	MyDelegate( 10 );
}

function DelegateFunction( int Param1 )
{
	LogInternal("DelegateFunction - Param1:" $ Param1);
}

function DelegateExample( Test0024_Commandlet Owner )
{
	CommandletOwner = Owner;

	LogInternal("First call ======================");
	TestDelegateParam(DelegateFunction);

	LogInternal("");
	LogInternal("Second Call ======================");
	TestDelegateParam(None);

	CommandletOwner.CommandletDelegate = CommandletOwner.CommandletDelegateFunction;

	LogInternal("");
	LogInternal("Third Call =====================");
	TestDelegateParam(CommandletOwner.CommandletDelegateFunction);
}

delegate SomeOtherDelegate( bool bFoo );

defaultproperties
{
   __ComparisonDelegate__Delegate=Default__Test0024_DelegateComparison.DelegateFunction
   Name="Default__Test0024_DelegateComparison"
   ObjectArchetype=TestClassBase'UnrealScriptTest.Default__TestClassBase'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: tr 31-1-2018 17:18:34.000 - Creation time: sk 18-3-2018 10:01:15.616 - Created with UnCodeX