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

Engine.SeqCond_SwitchObject


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
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
/**
 * Base class for all switch condition ops which use an object value for branching.
 *
 * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved
 */
class SeqCond_SwitchObject extends SeqCond_SwitchBase
	native(inherit);

// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)

/** Stores class name to compare for each output link and whether it should fall through to next node */
struct native SwitchObjectCase
{
	/** the value of this case statement */
	var() Object	ObjectValue;

	/** indicates whether control should fall through to the next case upon a match*/
	var() bool		bFallThru;

	/** true if this represents the default value option */
	var() bool		bDefaultValue;
};

/**
 * Stores the list of values which are handled by this switch object.
 */
var() array<SwitchObjectCase>	SupportedValues;

/**
 * Limits which types of objects can be used by this switch op.
 *
 * @fixme ronp - not yet implemented!
 */
var() class						MetaClass;

/* === Events === */
/**
 * Ensures that the last item in the value array represents the "default" item.  Child classes should override this method to ensure that
 * their value array stays synchronized with the OutputLinks array.
 */
event VerifyDefaultCaseValue()
{
	local int i;

	Super.VerifyDefaultCaseValue();

	SupportedValues.Length = OutputLinks.Length;
	for ( i = 0; i < SupportedValues.Length - 1; i++ )
	{
		SupportedValues[i].bDefaultValue = false;
	}

	SupportedValues[SupportedValues.Length-1].ObjectValue = None;
	SupportedValues[SupportedValues.Length-1].bFallThru = false;
	SupportedValues[SupportedValues.Length-1].bDefaultValue = true;
}

/**
 * Returns whether fall through is enabled for the specified case value.
 */
event bool IsFallThruEnabled( int ValueIndex )
{
	// by default, fall thru is not enabled on anything
	return ValueIndex >= 0 && ValueIndex < SupportedValues.Length && SupportedValues[ValueIndex].bFallThru;
}

/**
 * Insert an empty element into this switch's value array at the specified index.
 */
event InsertValueEntry( int InsertIndex )
{
	InsertIndex = Clamp(InsertIndex, 0, SupportedValues.Length);

	SupportedValues.Insert(InsertIndex, 1);
}

/**
 * Remove an element from this switch's value array at the specified index.
 */
event RemoveValueEntry( int RemoveIndex )
{
	if ( RemoveIndex >= 0 && RemoveIndex < SupportedValues.Length )
	{
		SupportedValues.Remove(RemoveIndex, 1);
	}
}

defaultproperties
{
   SupportedValues(0)=(bDefaultValue=True)
   MetaClass=Class'Core.Object'
   VariableLinks(0)=(ExpectedType=Class'Engine.SeqVar_Object',LinkDesc="Object",MinVars=1,MaxVars=255)
   ObjName="Switch Object"
   Name="Default__SeqCond_SwitchObject"
   ObjectArchetype=SeqCond_SwitchBase'Engine.Default__SeqCond_SwitchBase'
}

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