////////////////////////////////////////////////////////////////////////////////
// Shot.h
// Copyright Bjoern Ganster
// Developed since 2020, Corona year 1
////////////////////////////////////////////////////////////////////////////////

#pragma once

#include "Mesh.h"
#include "MWBase.h"

struct MountedWeapon;
class Vehicle;

// Base class for shots in MechVM
class Shot: public Mesh {
public:
	// The vehicle that fired the shoot
	// (used to update the position, and a shot cannot hit the vehicle itself)
	Vehicle* shooter;

	// Timestamp when this shot was triggered
	DWORD triggeredWhen;

	// Pointer to the mounted weapon
	MountedWeapon* weapon;

	Point3D position, flightDir;

	double velocity;

	bool alive;

	double damageCarried;

	Shot()
	: Mesh("Shot", shotID),
	  shooter(nullptr),
	  weapon(nullptr),
	  alive(true),
	  velocity(50.0),
	  damageCarried(1.0)
	{
	}

	~Shot()
	{
		// Default behaviour ...
	}
};
