class GemplayObjectiveData extends IScriptable
{
	protected instanceeditable var m_questUniqueId : String;
	protected instanceeditable var m_questTitle : String;
	protected instanceeditable var m_objectiveDescription : String;
	private var m_uniqueId : String;
	private var m_ownerID : EntityID;
	private var m_objectiveEntryID : String;
	private var m_uniqueIdPrefix : String;
	private persistent var m_objectiveState : gameJournalEntryState;
	default m_objectiveState = gameJournalEntryState.Undefined;

	public const function GetObjectiveEntryID() : String
	{
		return m_objectiveEntryID;
	}

	public function SetObjectiveEntryID( const objectiveEntryID : ref< String > )
	{
		m_objectiveEntryID = objectiveEntryID;
	}

	public const function GetOwnerID() : EntityID
	{
		return m_ownerID;
	}

	public function SetOwnerID( requesterID : EntityID )
	{
		m_ownerID = requesterID;
	}

	public const function GetQuestTitle() : String
	{
		return m_questTitle;
	}

	public const function GetObjectiveDescription() : String
	{
		return m_objectiveDescription;
	}

	public function GetUniqueID() : String
	{
		if( !( IsStringValid( m_uniqueId ) ) )
		{
			CreateUniqueID( m_ownerID );
		}
		return m_uniqueId;
	}

	protected function CreateUniqueID( entityID : EntityID )
	{
		if( IsStringValid( m_questUniqueId ) )
		{
			m_uniqueId = m_questUniqueId;
		}
		else
		{
			m_uniqueId = m_uniqueIdPrefix += EntityID.ToDebugStringDecimal( entityID );
		}
	}

	public const function IsCreated() : Bool
	{
		return m_objectiveState != gameJournalEntryState.Undefined;
	}

	public function SetObjectiveState( state : gameJournalEntryState )
	{
		m_objectiveState = state;
	}

	public const function GetObjectiveState() : gameJournalEntryState
	{
		return m_objectiveState;
	}

}

class BackDoorObjectiveData extends GemplayObjectiveData
{
	default m_questUniqueId = "NETWORK";
	default m_questTitle = "NETWORK";
	default m_objectiveDescription = "Hack backdoor in order to get access to the network";
	default m_uniqueIdPrefix = "backdoor";
}

class ControlPanelObjectiveData extends GemplayObjectiveData
{
	default m_questUniqueId = "TECHNICAL_GRID";
	default m_questTitle = "TECHNICAL GRID";
	default m_objectiveDescription = "Gain access to control panel in order to manipulate devices";
	default m_uniqueIdPrefix = "controlPanel";
}

