My Shortie: Ray Camden's Beginner ColdFusion Contest (Monster Maker)

<cfcomponent
	output="false"
	hint="This component defines interactions with your Shortie. This is the base interaction that has zeroed out values. This interaction's INIT method should be overridden by specific interactions.">

	<!---
		Run pseudo constructor. Here is where we can set
		up default data structures and data values.
	--->

	<!---
		Create a private data structure to hold all instance
		related data.
	--->
	<cfset VARIABLES.Instance = StructNew() />

	<!--- The name of the interaction. --->
	<cfset VARIABLES.Instance.Name = "" />

	<!---
		This is the unique key for this interaction. No TWO
		interactions should share the same key. This will help
		the user keep track of repetative interactions.
	--->
	<cfset VARIABLES.Instance.Key = "base_interaction" />

	<!---
		This is the amount of time that the interaction
		requires. All interactions require a minimum of 1 hour
		(shortie hour, not real world hour). Some interactions
		will take longer.
	--->
	<cfset VARIABLES.Instance.TimeRequired = CreateTimeSpan(
		0, <!--- Days. --->
		1, <!--- Hours. --->
		0, <!--- Minutes. --->
		0 <!--- Seconds. --->
		) />

	<!---
		The following are suggested values as to how this
		interaction will leave the user feeling. How the user
		actually interpruts these values is out of our hands.
		Positive values means that this interaction should
		leave the end user feeling more of that dimension.
		Negative numbers should leave the end user feeling
		less of that dimension.
	--->

	<!---
		This is how much love (feelings of being loved) a
		user should feel after this interaction.
	--->
	<cfset VARIABLES.Instance.Love = 0 />

	<!---
		This is how much anger a user should feel after
		this interaction.
	--->
	<cfset VARIABLES.Instance.Anger = 0 />

	<!---
		This is how much hunger a user should feel after
		this interaction (negative values, for example,
		means less hungry).
	--->
	<cfset VARIABLES.Instance.Hunger = 0 />

	<!---
		This is how much happiness a user should feel
		after this interaction.
	--->
	<cfset VARIABLES.Instance.Happiness = 0 />

	<!---
		This is how much energy consumption is used after
		this interaction (a negative value here means that
		the user had to PUT OUT energy to perform this
		interaction. A positive value, such as that defined
		by sleep, would result in a higher final eneregy).
	--->
	<cfset VARIABLES.Instance.Energy = 0 />

	<!---
		This is a subjective flag as to whether the
		interaction in general is thought of as a positive
		or negative one. This flag will not always determine
		how the end user views this interaction.
	--->
	<cfset VARIABLES.Instance.IsPositive = true />



	<cffunction
		name="Init"
		access="public"
		returntype="any"
		output="false"
		hint="Returns an initialized Interaction component. This method is supposed to be overriden by interactions that extend this base interaction.">

		<!--- Return This reference. --->
		<cfreturn THIS />
	</cffunction>


	<cffunction
		name="GetAnger"
		access="public"
		returntype="numeric"
		output="false"
		hint="Gets the anger rating.">

		<cfreturn VARIABLES.Instance.Anger />
	</cffunction>


	<cffunction
		name="GetEnergy"
		access="public"
		returntype="numeric"
		output="false"
		hint="Gets the energy rating.">

		<cfreturn VARIABLES.Instance.Energy />
	</cffunction>


	<cffunction
		name="GetHappiness"
		access="public"
		returntype="numeric"
		output="false"
		hint="Gets the happiness rating.">

		<cfreturn VARIABLES.Instance.Happiness />
	</cffunction>


	<cffunction
		name="GetHunger"
		access="public"
		returntype="numeric"
		output="false"
		hint="Gets the hunger rating.">

		<cfreturn VARIABLES.Instance.Hunger />
	</cffunction>


	<cffunction
		name="GetIsPositive"
		access="public"
		returntype="boolean"
		output="false"
		hint="Gets the positive vs. negative falg.">

		<cfreturn VARIABLES.Instance.IsPositive />
	</cffunction>


	<cffunction
		name="GetKey"
		access="public"
		returntype="string"
		output="false"
		hint="Gets the interaction key.">

		<cfreturn VARIABLES.Instance.Key />
	</cffunction>


	<cffunction
		name="GetLove"
		access="public"
		returntype="numeric"
		output="false"
		hint="Gets the love rating.">

		<cfreturn VARIABLES.Instance.Love />
	</cffunction>


	<cffunction
		name="GetTimeRequired"
		access="public"
		returntype="numeric"
		output="false"
		hint="Gets the time required to perform action.">

		<cfreturn VARIABLES.Instance.TimeRequired />
	</cffunction>

</cfcomponent>

For Cut-and-Paste