/*********************************************************************//**
*	\brief Informace o utoku
*	Implementace jednotky utoku pomoci projektilu s okamzitym ucinkem,
*	tj. s nekonecnou rychlosti.
*
*	\author Michal Jirous
*	\date 18.12.2008
*	\file attack_info.h
**********************************************************************/

#ifndef __ATTACK_INFO_H__
#define __ATTACK_INFO_H__

#include "algebraic.h"
#include "damage_types.h"

class CBaseEntity;

const float ZERO_DEGREES = 0.0f;

const float INFINITE_DISTANCE = 100000.0f;

/** Objekt s intormacemi o utoku. */
struct AttackInfo
{
	Point m_Start;				/*!< @brief Pocatecni bod. */
	Point m_End;				/*!< @brief Vypocteny koncovy bod. */
	CBaseEntity *m_pInitiator;	/*!< @brief Vlastnik projektilu. */
	Vector m_vecDirection;		/*!< @brief Smer projektilu. */
	int m_iDamageType;			/*!< @brief Typ zraneni. */
	int m_iDamage;				/*!< @brief Velikost zraneni. */
	float m_fDistance;			/*!< @brief Maximalni cilova vzdalenost. */
	bool m_bSoundPlayed;
	int m_iMaterial;
	void *face;

	void create( Point &start, Vector &direction, CBaseEntity *who, int damage, float distance = INFINITE_DISTANCE, int damage_type = dmg::GENERIC, float dispersion = ZERO_DEGREES );
	/** @brief Konstruktor k inicializaci vsech parametru utoku. */
	AttackInfo( Point &start, Vector &direction, CBaseEntity *who, int damage, float distance = INFINITE_DISTANCE, int damage_type = dmg::GENERIC, float dispersion = ZERO_DEGREES );
	
	AttackInfo() { memset( this, 0, sizeof( *this) ); }
};

#endif
