mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-07 19:32:49 +01:00
28 lines
612 B
C++
28 lines
612 B
C++
#pragma once
|
|
#ifndef _WEAPONITEM_HPP_
|
|
#define _WEAPONITEM_HPP_
|
|
#include <items/InventoryItem.hpp>
|
|
#include <data/WeaponData.hpp>
|
|
#include <memory>
|
|
|
|
class WeaponItem : public InventoryItem
|
|
{
|
|
std::shared_ptr<WeaponData> _wepData;
|
|
|
|
bool _firing;
|
|
public:
|
|
WeaponItem(std::shared_ptr<WeaponData> data)
|
|
: InventoryItem(data->inventorySlot, data->modelID), _wepData(data)
|
|
{}
|
|
|
|
void primary(CharacterObject* character, bool active);
|
|
|
|
void secondary(CharacterObject* character, bool active);
|
|
|
|
bool isFiring() const { return _firing; }
|
|
|
|
std::shared_ptr<WeaponData>& getWeaponData() { return _wepData; }
|
|
};
|
|
|
|
#endif
|