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


#include "BaseItem.h"


void UBaseItem::PostInitProperties()
{
	Super::PostInitProperties();
	ItemSize = FItemSize(DefaultItemSize.X, DefaultItemSize.Y);
}

void UBaseItem::RotateItem()
{
	if (CurrentItemRotation == Horizontal)
	{
		CurrentItemRotation = Vertical;
		ItemSize = FItemSize(ItemSize.Y, ItemSize.X);
		bIsRotated = true;
	}
	else
	{
		CurrentItemRotation = Horizontal;
		ItemSize = FItemSize(ItemSize.Y, ItemSize.X);
		bIsRotated = false;
	}
}

UMaterialInterface* UBaseItem::GetItemTexture() const
{
	if (bIsRotated)
	{
		return ItemTextureRotated;
	}
	return ItemTexture;
}
