<feat: New project structure>

<feat: New release>
This commit is contained in:
Alessandro Autiero
2023-09-02 15:34:15 +02:00
parent 64b33102f4
commit b41e22adeb
953 changed files with 1373072 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
#pragma once
#include "BuildingActor.h"
#include "PlayerState.h"
enum class EFortResourceType : uint8_t
{
Wood = 0,
Stone = 1,
Metal = 2,
Permanite = 3,
None = 4,
EFortResourceType_MAX = 5
};
class ABuildingSMActor : public ABuildingActor
{
public:
bool IsPlayerPlaced()
{
static auto bPlayerPlacedOffset = GetOffset("bPlayerPlaced");
static auto bPlayerPlacedFieldMask = GetFieldMask(this->GetProperty("bPlayerPlaced"));
return ReadBitfieldValue(bPlayerPlacedOffset, bPlayerPlacedFieldMask);
}
void SetPlayerPlaced(bool NewValue)
{
static auto bPlayerPlacedOffset = GetOffset("bPlayerPlaced");
static auto bPlayerPlacedFieldMask = GetFieldMask(this->GetProperty("bPlayerPlaced"));
this->SetBitfieldValue(bPlayerPlacedOffset, bPlayerPlacedFieldMask, NewValue);
}
APlayerState*& GetEditingPlayer()
{
static auto EditingPlayerOffset = GetOffset("EditingPlayer");
return Get<APlayerState*>(EditingPlayerOffset);
}
int& GetCurrentBuildingLevel()
{
static auto CurrentBuildingLevelOffset = GetOffset("CurrentBuildingLevel");
return Get<int>(CurrentBuildingLevelOffset);
}
EFortResourceType& GetResourceType()
{
static auto ResourceTypeOffset = GetOffset("ResourceType");
return Get<EFortResourceType>(ResourceTypeOffset);
}
void SetEditingPlayer(APlayerState* NewEditingPlayer) // actually AFortPlayerStateZone
{
if (// AActor::HasAuthority() &&
(!GetEditingPlayer() || !NewEditingPlayer)
)
{
SetNetDormancy((ENetDormancy)(2 - (NewEditingPlayer != 0)));
// they do something here
GetEditingPlayer() = NewEditingPlayer;
}
}
static UClass* StaticClass();
};