// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "WeaponEnums.h"
// #include "UMagazine.h"
#include "WeaponBase.generated.h"

UCLASS()
class OPENCONFLICT_API AWeaponBase : public AActor
{
	GENERATED_BODY()

	/*UPROPERTY and UFUNCTION declarations*/
private:
	/*Properties*/
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Weapon HUD", meta=(AllowPrivateAccess=true))
	UTexture2D* Texture;

	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Weapon Anims", meta=(AllowPrivateAccess=true))
	WeaponNames WeaponNameEnum;

	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Weapon Anims", meta=(AllowPrivateAccess=true))
	FName AttachSocketName; 
	
	/*Ammo counter for in mags*/
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Weapon Ammo", meta=(AllowPrivateAccess=true))
	int MAX_AMMO_COUNT = 30; //Tracks max ammo in one mag, not to be edited during runtime ever
	UPROPERTY(BlueprintReadOnly, Category="Weapon Ammo", meta=(AllowPrivateAccess=true))
	int MagIndex; //Tracks index for ActiveMags Array
	// UPROPERTY(BlueprintReadOnly, Category="Weapon Ammo", meta=(AllowPrivateAccess=true))
	// TArray<UMagazine*> ActiveMags; //Tracks all mags for weapon
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Weapon Ammo", meta=(AllowPrivateAccess=true))
	int RESERVE_MAG_COUNT = 2; //Tracks how many mags are kept in reserve. DO NOT INCLUDE MAG IN WEAPON
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="Weapon Ammo", meta=(AllowPrivateAccess=true))
	int RESERVE_AMMO_POOL_DEFAULT = 120;
	
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, meta=(AllowPrivateAccess=true))
	USkeletalMeshComponent* WeaponMesh;

	/*Functions*/

protected:
	/*Properties*/

	/*Functions*/

public:
	/*Properties*/
	// UPROPERTY(BlueprintAssignable)
	// FAMMO_REPACK AMMO_REPACK;

	/*Functions*/
	UFUNCTION()
	void MagRepacking();

	/*C++ only declarations*/
private:
	/*Properties*/

	/*Functions*/

protected:
	/*Properties*/

	/*Functions*/
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:
	/*Properties*/

	/*Functions*/
	// Called every frame
	virtual void Tick(float DeltaTime) override;
	
	// Sets default values for this actor's properties
	AWeaponBase();
	
};
