Skip to main content

Unreal Engine API Reference

Complete API reference for the Vidya Unreal Engine SDK.

Core Classes

UVidyaSDK

The main subsystem for interacting with Vidya in Unreal Engine.

UCLASS()
class VIDYASDK_API UVidyaSDK : public UGameInstanceSubsystem
{
GENERATED_BODY()

public:
// Singleton access
static UVidyaSDK* Get(const UObject* WorldContext);

// Module access
UPROPERTY(BlueprintReadOnly, Category = "Vidya")
UAuthModule* Auth;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
UInventoryModule* Inventory;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
UMarketplaceModule* Marketplace;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
UCraftingModule* Crafting;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
UGachaModule* Gacha;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
ULeaderboardModule* Leaderboard;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
USocialModule* Social;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
UNPCModule* NPC;

// Methods
UFUNCTION(BlueprintCallable, Category = "Vidya")
void Initialize(const FVidyaConfig& Config);

UFUNCTION(BlueprintCallable, Category = "Vidya")
void GetProject(FOnProjectReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintPure, Category = "Vidya")
FSession GetSession() const;

UFUNCTION(BlueprintCallable, Category = "Vidya")
void SetSession(const FSession& Session);

UFUNCTION(BlueprintCallable, Category = "Vidya")
void ClearSession();

// Events
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnSessionChanged, const FSession&, Session);
UPROPERTY(BlueprintAssignable, Category = "Vidya")
FOnSessionChanged OnSessionChanged;

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnVidyaErrorOccurred, const FVidyaError&, Error);
UPROPERTY(BlueprintAssignable, Category = "Vidya")
FOnVidyaErrorOccurred OnErrorOccurred;
};

UPlayer

Represents a player with full type safety.

UCLASS(BlueprintType)
class VIDYASDK_API UPlayer : public UObject
{
GENERATED_BODY()

public:
// Static factory methods
UFUNCTION(BlueprintCallable, Category = "Vidya", meta = (DisplayName = "From Session"))
static UPlayer* FromSession(const FSession& Session);

UFUNCTION(BlueprintCallable, Category = "Vidya", meta = (DisplayName = "From Wallet"))
static UPlayer* FromWallet(const FString& Wallet);

// Properties
UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Id;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Wallet;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
bool bCanWrite;

// Methods
UFUNCTION(BlueprintCallable, Category = "Vidya")
void RequireWrite();

UFUNCTION(BlueprintCallable, Category = "Vidya", meta = (DisplayName = "Get Profile"))
void GetProfile(FOnPlayerProfileReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya", meta = (DisplayName = "Get Stats"))
void GetStats(FOnPlayerStatsReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya", meta = (DisplayName = "Get Achievements"))
void GetAchievements(FOnAchievementsReceived OnSuccess, FOnVidyaError OnError);

// Comparison
UFUNCTION(BlueprintPure, Category = "Vidya")
bool Equals(const UPlayer* Other) const;
};

UItem

Represents an in-game item with Unreal Engine integration.

UCLASS(BlueprintType)
class VIDYASDK_API UItem : public UObject
{
GENERATED_BODY()

public:
// Properties
UPROPERTY(BlueprintReadOnly, Category = "Vidya")
int32 Id;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Name;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Description;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Image;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
TArray<FItemAttribute> Attributes;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Owner;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
int32 Balance;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
bool bEquipped;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
bool bTradeable;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
bool bConsumable;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
bool bStackable;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
int32 MaxStack;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
ECharacterSlot CharacterSlot;

// Unreal-specific
UPROPERTY(BlueprintReadOnly, Category = "Vidya")
UTexture2D* Texture;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
TSubclassOf<AActor> ItemClass;

// Methods
UFUNCTION(BlueprintCallable, Category = "Vidya")
void Transfer(UPlayer* To, int32 Quantity, FOnTransferComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya")
void Equip(FOnEquipComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya")
void Unequip(FOnUnequipComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya")
void Consume(int32 Quantity, FOnConsumeComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya")
void List(const FString& Price, int32 Quantity, FOnListingCreated OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya")
void GetListings(FOnListingsReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya")
void Burn(int32 Quantity, FOnBurnComplete OnSuccess, FOnVidyaError OnError);

// Unreal helpers
UFUNCTION(BlueprintCallable, Category = "Vidya")
void LoadTexture(FOnTextureLoaded OnLoaded);

UFUNCTION(BlueprintCallable, Category = "Vidya", meta = (WorldContext = "WorldContextObject"))
AActor* SpawnActor(UObject* WorldContextObject, const FTransform& Transform);
};

Modules

UAuthModule

Handles authentication in Unreal Engine.

UCLASS(BlueprintType)
class VIDYASDK_API UAuthModule : public UObject
{
GENERATED_BODY()

public:
// Methods
UFUNCTION(BlueprintCallable, Category = "Vidya|Auth")
void Login(const FLoginOptions& Options, FOnLoginComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Auth")
void Logout(FOnLogoutComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Auth")
void RefreshSession(FOnSessionRefreshed OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintPure, Category = "Vidya|Auth")
FSession GetSession() const;

// OAuth providers
UFUNCTION(BlueprintCallable, Category = "Vidya|Auth")
void LoginWithGoogle(FOnLoginComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Auth")
void LoginWithDiscord(FOnLoginComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Auth")
void LoginWithTwitter(FOnLoginComplete OnSuccess, FOnVidyaError OnError);

// Wallet authentication
UFUNCTION(BlueprintCallable, Category = "Vidya|Auth")
void LoginWithWallet(const FWalletLoginOptions& Options, FOnLoginComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Auth")
void ConnectWallet(EWalletType Type, FOnWalletConnected OnSuccess, FOnVidyaError OnError);

// Events
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnAuthLogin, const FSession&, Session);
UPROPERTY(BlueprintAssignable, Category = "Vidya|Auth")
FOnAuthLogin OnLogin;

DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnAuthLogout);
UPROPERTY(BlueprintAssignable, Category = "Vidya|Auth")
FOnAuthLogout OnLogout;
};

UInventoryModule

Manages player inventory with Unreal Engine features.

UCLASS(BlueprintType)
class VIDYASDK_API UInventoryModule : public UObject
{
GENERATED_BODY()

public:
// Item retrieval
UFUNCTION(BlueprintCallable, Category = "Vidya|Inventory")
void GetItems(UPlayer* Player, FOnItemsReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Inventory", meta = (DisplayName = "Get Item By Predicate"))
void GetItemByPredicate(UPlayer* Player, const FItemPredicate& Predicate, FOnItemReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Inventory", meta = (DisplayName = "Get Item By ID"))
void GetItemById(UPlayer* Player, int32 ItemId, FOnItemReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Inventory")
void GetEquippedItems(UPlayer* Player, FOnItemsReceived OnSuccess, FOnVidyaError OnError);

// Item operations
UFUNCTION(BlueprintCallable, Category = "Vidya|Inventory")
void EquipItem(const FEquipParams& Params, FOnOperationComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Inventory")
void UnequipItem(const FUnequipParams& Params, FOnOperationComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Inventory")
void TransferItem(const FTransferParams& Params, FOnOperationComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Inventory")
void ConsumeItem(const FConsumeParams& Params, FOnOperationComplete OnSuccess, FOnVidyaError OnError);

// Batch operations
UFUNCTION(BlueprintCallable, Category = "Vidya|Inventory")
void TransferBatch(const FBatchTransferParams& Params, FOnOperationComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Inventory")
void EquipBatch(const FBatchEquipParams& Params, FOnOperationComplete OnSuccess, FOnVidyaError OnError);

// Unreal-specific
UFUNCTION(BlueprintCallable, Category = "Vidya|Inventory", meta = (WorldContext = "WorldContextObject"))
UInventoryWidget* CreateInventoryUI(UObject* WorldContextObject);

// Events
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnInventoryItemsChanged, const TArray<UItem*>&, Items);
UPROPERTY(BlueprintAssignable, Category = "Vidya|Inventory")
FOnInventoryItemsChanged OnItemsChanged;

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnInventoryItemEquipped, UItem*, Item);
UPROPERTY(BlueprintAssignable, Category = "Vidya|Inventory")
FOnInventoryItemEquipped OnItemEquipped;
};

UMarketplaceModule

Marketplace functionality for Unreal Engine.

UCLASS(BlueprintType)
class VIDYASDK_API UMarketplaceModule : public UObject
{
GENERATED_BODY()

public:
// Listing management
UFUNCTION(BlueprintCallable, Category = "Vidya|Marketplace")
void CreateListing(const FCreateListingParams& Params, FOnListingCreated OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Marketplace")
void CancelListing(const FString& ListingId, FOnOperationComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Marketplace")
void GetListings(const FListingFilter& Filter, FOnListingsReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Marketplace")
void GetPlayerListings(UPlayer* Player, FOnListingsReceived OnSuccess, FOnVidyaError OnError);

// Trading
UFUNCTION(BlueprintCallable, Category = "Vidya|Marketplace")
void BuyListing(const FString& ListingId, int32 Quantity, FOnPurchaseComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Marketplace")
void MakeOffer(const FOfferParams& Params, FOnOfferCreated OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Marketplace")
void AcceptOffer(const FString& OfferId, FOnOperationComplete OnSuccess, FOnVidyaError OnError);

// Price data
UFUNCTION(BlueprintCallable, Category = "Vidya|Marketplace")
void GetItemPriceHistory(int32 ItemId, FOnPriceHistoryReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Marketplace")
void GetFloorPrice(int32 ItemId, FOnFloorPriceReceived OnSuccess, FOnVidyaError OnError);

// Unreal UI
UFUNCTION(BlueprintCallable, Category = "Vidya|Marketplace", meta = (WorldContext = "WorldContextObject"))
UMarketplaceWidget* CreateMarketplaceUI(UObject* WorldContextObject);

// Events
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnMarketplaceListingCreated, const FListing&, Listing);
UPROPERTY(BlueprintAssignable, Category = "Vidya|Marketplace")
FOnMarketplaceListingCreated OnListingCreatedEvent;
};

UCraftingModule

Crafting system for Unreal Engine.

UCLASS(BlueprintType)
class VIDYASDK_API UCraftingModule : public UObject
{
GENERATED_BODY()

public:
// Recipe management
UFUNCTION(BlueprintCallable, Category = "Vidya|Crafting")
void GetRecipes(FOnRecipesReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Crafting")
void GetRecipe(int32 RecipeId, FOnRecipeReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Crafting")
void GetAvailableRecipes(UPlayer* Player, FOnRecipesReceived OnSuccess, FOnVidyaError OnError);

// Crafting
UFUNCTION(BlueprintCallable, Category = "Vidya|Crafting")
void Craft(UPlayer* Player, int32 RecipeId, int32 Quantity, FOnCraftComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Crafting")
void GetCraftingCost(int32 RecipeId, int32 Quantity, FOnCraftingCostReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Crafting")
void CanCraft(UPlayer* Player, int32 RecipeId, int32 Quantity, FOnCanCraftReceived OnSuccess, FOnVidyaError OnError);

// Unreal UI and animations
UFUNCTION(BlueprintCallable, Category = "Vidya|Crafting", meta = (WorldContext = "WorldContextObject"))
UCraftingWidget* CreateCraftingUI(UObject* WorldContextObject);

UFUNCTION(BlueprintImplementableEvent, Category = "Vidya|Crafting")
void PlayCraftingAnimation(const FRecipe& Recipe);

// Events
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnCraftingItemCrafted, const FCraftResult&, Result);
UPROPERTY(BlueprintAssignable, Category = "Vidya|Crafting")
FOnCraftingItemCrafted OnItemCrafted;
};

UGachaModule

Gacha/loot box system for Unreal Engine.

UCLASS(BlueprintType)
class VIDYASDK_API UGachaModule : public UObject
{
GENERATED_BODY()

public:
// Gacha pools
UFUNCTION(BlueprintCallable, Category = "Vidya|Gacha")
void GetPools(FOnGachaPoolsReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Gacha")
void GetPool(const FString& PoolId, FOnGachaPoolReceived OnSuccess, FOnVidyaError OnError);

// Rolling
UFUNCTION(BlueprintCallable, Category = "Vidya|Gacha")
void Roll(UPlayer* Player, const FString& PoolId, int32 Count, FOnGachaRollComplete OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Gacha")
void GetRollCost(const FString& PoolId, int32 Count, FOnRollCostReceived OnSuccess, FOnVidyaError OnError);

UFUNCTION(BlueprintCallable, Category = "Vidya|Gacha")
void GetPityStatus(UPlayer* Player, const FString& PoolId, FOnPityStatusReceived OnSuccess, FOnVidyaError OnError);

// Unreal animations
UFUNCTION(BlueprintImplementableEvent, Category = "Vidya|Gacha")
void PlayGachaAnimation(const FGachaResult& Result);

UFUNCTION(BlueprintCallable, Category = "Vidya|Gacha")
UParticleSystemComponent* CreateGachaEffect(ERarity Rarity, const FVector& Location);

// Events
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnGachaRoll, const FGachaResult&, Result);
UPROPERTY(BlueprintAssignable, Category = "Vidya|Gacha")
FOnGachaRoll OnRoll;
};

Blueprint Function Library

UCLASS()
class VIDYASDK_API UVidyaBlueprintLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()

public:
// Player creation helpers
UFUNCTION(BlueprintPure, Category = "Vidya", meta = (DisplayName = "Create Player From Session"))
static UPlayer* CreatePlayerFromSession(const FSession& Session);

UFUNCTION(BlueprintPure, Category = "Vidya", meta = (DisplayName = "Create Player From Wallet"))
static UPlayer* CreatePlayerFromWallet(const FString& Wallet);

// Currency formatting
UFUNCTION(BlueprintPure, Category = "Vidya")
static FString FormatCurrency(const FString& Amount, int32 Decimals = 18);

UFUNCTION(BlueprintPure, Category = "Vidya")
static FString ParseCurrency(const FString& Value, int32 Decimals = 18);

// Item utilities
UFUNCTION(BlueprintPure, Category = "Vidya")
static TArray<UItem*> SortItems(const TArray<UItem*>& Items, EItemSortMethod SortBy);

UFUNCTION(BlueprintPure, Category = "Vidya")
static TArray<UItem*> FilterItems(const TArray<UItem*>& Items, const FItemFilter& Filter);

// Validation
UFUNCTION(BlueprintPure, Category = "Vidya")
static bool IsValidWalletAddress(const FString& Address);

UFUNCTION(BlueprintPure, Category = "Vidya")
static bool IsValidPlayerId(const FString& Id);
};

Actor Components

UInventoryComponent

UCLASS(ClassGroup=(Vidya), meta=(BlueprintSpawnableComponent))
class VIDYASDK_API UInventoryComponent : public UActorComponent
{
GENERATED_BODY()

public:
// Properties
UPROPERTY(BlueprintReadOnly, Category = "Vidya")
TArray<UItem*> Items;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
TMap<ECharacterSlot, UItem*> EquippedItems;

// Methods
UFUNCTION(BlueprintCallable, Category = "Vidya")
void RefreshInventory(UPlayer* Player);

UFUNCTION(BlueprintCallable, Category = "Vidya")
bool HasItem(int32 ItemId, int32 Quantity = 1) const;

UFUNCTION(BlueprintCallable, Category = "Vidya")
UItem* GetItem(int32 ItemId) const;

UFUNCTION(BlueprintCallable, Category = "Vidya")
void EquipItem(UItem* Item, ECharacterSlot Slot);

// Events
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnInventoryUpdated);
UPROPERTY(BlueprintAssignable, Category = "Vidya")
FOnInventoryUpdated OnInventoryUpdated;
};

Data Types and Structures

Core Structures

USTRUCT(BlueprintType)
struct FVidyaConfig
{
GENERATED_BODY()

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Vidya")
FString ProjectId;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Vidya")
EVidyaEnvironment Environment;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Vidya")
FString ApiUrl;

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Vidya")
bool bDebug;
};

USTRUCT(BlueprintType)
struct FSession
{
GENERATED_BODY()

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Id;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FPlayerInfo Player;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Wallet;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FDateTime ExpiresAt;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString RefreshToken;
};

Enumerations

UENUM(BlueprintType)
enum class EVidyaEnvironment : uint8
{
Development,
Staging,
Production
};

UENUM(BlueprintType)
enum class ECharacterSlot : uint8
{
None = 0,
Head = 1,
Body = 2,
Legs = 3,
Feet = 4,
Hands = 5,
Weapon = 6,
Shield = 7,
Accessory = 8
};

UENUM(BlueprintType)
enum class ERarity : uint8
{
Common = 1,
Uncommon = 2,
Rare = 3,
Epic = 4,
Legendary = 5
};

UENUM(BlueprintType)
enum class EAuthProvider : uint8
{
Google,
Discord,
Twitter,
Wallet
};

UENUM(BlueprintType)
enum class EWalletType : uint8
{
MetaMask,
WalletConnect,
Phantom,
Coinbase
};

Item Structures

USTRUCT(BlueprintType)
struct FItemAttribute
{
GENERATED_BODY()

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
int32 Id;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Name;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Value;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString DisplayValue;
};

USTRUCT(BlueprintType)
struct FEquipParams
{
GENERATED_BODY()

UPROPERTY(BlueprintReadWrite, Category = "Vidya")
UPlayer* Player;

UPROPERTY(BlueprintReadWrite, Category = "Vidya")
UItem* Item;

UPROPERTY(BlueprintReadWrite, Category = "Vidya")
ECharacterSlot Slot;
};

Marketplace Structures

USTRUCT(BlueprintType)
struct FListing
{
GENERATED_BODY()

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Id;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Seller;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
UItem* Item;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Price;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
int32 Quantity;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FDateTime CreatedAt;
};

USTRUCT(BlueprintType)
struct FListingFilter
{
GENERATED_BODY()

UPROPERTY(BlueprintReadWrite, Category = "Vidya")
int32 ItemId;

UPROPERTY(BlueprintReadWrite, Category = "Vidya")
FString MinPrice;

UPROPERTY(BlueprintReadWrite, Category = "Vidya")
FString MaxPrice;

UPROPERTY(BlueprintReadWrite, Category = "Vidya")
ECharacterSlot CharacterSlot;
};

Error Handling

USTRUCT(BlueprintType)
struct FVidyaError
{
GENERATED_BODY()

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Message;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
EVidyaErrorCode Code;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
FString Details;
};

UENUM(BlueprintType)
enum class EVidyaErrorCode : uint8
{
// Authentication
Unauthenticated,
Unauthorized,
SessionExpired,

// Validation
InvalidParameter,
InsufficientBalance,
ItemNotFound,

// Operations
OperationFailed,
TransactionFailed,
RateLimited,

// Network
NetworkError,
Timeout
};

Widget Classes

// Base inventory widget
UCLASS()
class VIDYASDK_API UInventoryWidget : public UUserWidget
{
GENERATED_BODY()

public:
UPROPERTY(meta = (BindWidget))
class UUniformGridPanel* ItemGrid;

UPROPERTY(EditDefaultsOnly, Category = "Vidya")
TSubclassOf<class UInventorySlotWidget> SlotWidgetClass;

UFUNCTION(BlueprintCallable, Category = "Vidya")
void RefreshInventory(const TArray<UItem*>& Items);

UFUNCTION(BlueprintImplementableEvent, Category = "Vidya")
void OnItemClicked(UItem* Item);
};

// Inventory slot widget
UCLASS()
class VIDYASDK_API UInventorySlotWidget : public UUserWidget
{
GENERATED_BODY()

public:
UPROPERTY(meta = (BindWidget))
class UImage* ItemIcon;

UPROPERTY(meta = (BindWidget))
class UTextBlock* QuantityText;

UPROPERTY(meta = (BindWidget))
class UBorder* EquippedBorder;

UPROPERTY(BlueprintReadOnly, Category = "Vidya")
UItem* Item;

UFUNCTION(BlueprintCallable, Category = "Vidya")
void SetItem(UItem* NewItem);

UFUNCTION(BlueprintCallable, Category = "Vidya")
void SetHighlight(bool bHighlighted);
};

Data Assets

// Vidya settings data asset
UCLASS()
class VIDYASDK_API UVidyaSettings : public UDataAsset
{
GENERATED_BODY()

public:
UPROPERTY(EditAnywhere, Category = "Vidya")
FVidyaConfig Config;

UPROPERTY(EditAnywhere, Category = "Vidya")
TMap<int32, TSubclassOf<AActor>> ItemActorClasses;

UPROPERTY(EditAnywhere, Category = "Vidya")
TMap<ERarity, UParticleSystem*> RarityEffects;

UPROPERTY(EditAnywhere, Category = "Vidya")
TMap<ERarity, USoundBase*> RaritySounds;
};

// Item data table row
USTRUCT(BlueprintType)
struct FItemTableRow : public FTableRowBase
{
GENERATED_BODY()

UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Item")
int32 ItemId;

UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Item")
UTexture2D* Icon;

UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Item")
TSubclassOf<AActor> ItemClass;

UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Item")
USoundBase* UseSound;

UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Item")
UParticleSystem* UseEffect;
};

Delegates

// Success callbacks
DECLARE_DELEGATE_OneParam(FOnLoginComplete, const FSession&);
DECLARE_DELEGATE_OneParam(FOnItemsReceived, const TArray<UItem*>&);
DECLARE_DELEGATE_OneParam(FOnListingCreated, const FListing&);
DECLARE_DELEGATE_OneParam(FOnGachaRollComplete, const FGachaResult&);

// Error callbacks
DECLARE_DELEGATE_OneParam(FOnVidyaError, const FVidyaError&);

// Generic operation complete
DECLARE_DELEGATE(FOnOperationComplete);

// Blueprint-compatible dynamic delegates
DECLARE_DYNAMIC_DELEGATE_OneParam(FOnLoginCompleteDelegate, const FSession&, Session);
DECLARE_DYNAMIC_DELEGATE_OneParam(FOnItemsReceivedDelegate, const TArray<UItem*>&, Items);
DECLARE_DYNAMIC_DELEGATE_OneParam(FOnVidyaErrorDelegate, const FVidyaError&, Error);

Plugin Module

class FVidyaSDKModule : public IModuleInterface
{
public:
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;

/** Gets the singleton instance */
static inline FVidyaSDKModule& Get()
{
return FModuleManager::LoadModuleChecked<FVidyaSDKModule>("VidyaSDK");
}

/** Checks if module is loaded */
static inline bool IsAvailable()
{
return FModuleManager::Get().IsModuleLoaded("VidyaSDK");
}
};