//////////////////////////////////////////////////////////////////////////////
//
// AVP_Pickup_Tool.cpp
//
// (AJK - 19.11.2008) Created
//
// Copyright (c) 2008 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////

#include "Core/Asura.h"

// This file's header.
#include "Entity/PhysicalObject/Pickup/AVP_Pickup_Tool.h"

// ASURA
#include "Blueprint/Asura_Blueprint.h"
#include "Blueprint/Asura_Blueprint_System.h"

// AVP
#include "Blueprint/AVP_Blueprint_HashIDs.h"

AVP_Pickup_Tool::AVP_Pickup_Tool(Asura_Hash_ID uBlueprintHash)
: AVP_Pickup_Weapon(uBlueprintHash)
, m_uSkinDestroyed(ASURA_HASH_ID_UNSET)
{
	m_ePickupType =AVP_Pickup::PICKUP_TYPE_TOOL;
}

void AVP_Pickup_Tool::InitFromBlueprint()
{
	Asura_Value xValue;
	Asura_Blueprint* pxBlueprint     = Asura_Blueprint_System::GetBlueprintByHashID( uAVP_BLUEPRINT_TYPE_PICKUPS, GetBlueprintHash());

	// Get destroyed skin hash
	if(pxBlueprint->GetParameterValueByHashID(uAVP_BLUEPRINT_PARAM_PICKUP_SKIN_DESTROYED, xValue))
	{
		m_uSkinDestroyed  = xValue.GetHashIDValue();
	}

	PARENT::InitFromBlueprint();
}

Asura_Hash_ID AVP_Pickup_Tool::GetGroupHash() const
{
	//If we are dealing with a "HackingTool" 
	return ( (GetBlueprintHash() == s_uHackingToolHash) ? uAVP_INVENTORY_GROUPHASH_TOOL : uAVP_INVENTORY_GROUPHASH_WEAPON );
}



