All pastes #211615 Raw Edit

Anonymous

public text v1 · immutable
#211615 ·published 2006-10-20 12:07 UTC
rendered paste body
objectdef FukabunRoamArea
{
	variable string Name
	
	method Initialize(string Text)
	{
		This.Name:Set[${Text}]
	}
}

objectdef FukabunRoam inherits ObjBaseObject
{
	variable index:FukabunRoamArea RoamAreas

	member State()
	{
		return STATE_ROAM_NONE
	}

	method ResetRoamAreas()
	{
		RoamAreas:Collapse
		if ${RoamAreas.Get[1](exists)}
		{
			do
			{
				RoamAreas:Remove[1]
			}
			while ${RoamAreas.Get[1](exists)}
		}
	}

	method ListRoamAreas()
	{
		variable FukabunRoamArea Area
		variable int Current = 1
		echo ${RoamAreas.Get[${Current}](exists)}
		if ${RoamAreas.Get[${Current}](exists)}
		{
			do
			{
				echo ${RoamAreas.Get[${Current}].Name}
			}
			while ${RoamAreas.Get[${Current:Inc}](exists)}
		}
	}
	
	method RoamAreaChanged()
	{
		variable int Total
		variable int Current = 1
		variable int Index
		This:ResetRoamAreas
		
		Total:Set[${UIElement[Areas@Roam areas@Pages@FukabunHuntGUI].SelectedItems}]
		do
		{
			Index:Set[${RoamAreas:Insert["${UIElement[Areas@Roam areas@Pages@FukabunHuntGUI].SelectedItem[${Current}]}"]}]
			This:Debug["Fukabun roam: Roam area ${UIElement[Areas@Roam areas@Pages@FukabunHuntGUI].SelectedItem[${Current}]} added to roam list"]
		}
		while ${Current:Inc}<=${Total}
		
		This:ListRoamAreas
	}