x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Making a data retrieval class

I'm using the class initialization wizard to create a simple data container class. I was wondering, what parent-class would be most appropriate (E.g. Actor, GameModeBase etc)? (I need a parent-class since I need to use UE4 specific functions and types like FString, TMap etc.)

For more context regarding the class I'm trying to implement, upon instantiation, it will load data from a CSV file. Said data will be stored in a TMap. The class' purpose beyond that is to simply retrieve the appropriate data when given a key. i.e. It will look something like this:

 class GetInfo {
     
     GetInfo()
  
     UPROPERTY()
     TMap<FString, FString> dataThatsBeenExtracted;
 
     UFUNCTION()
     void LoadData();
 
     UFUNCTION()
     FString getData(FString key);
 
 }

 
Product Version: UE 4.19
Tags:
more ▼

asked Aug 21 '18 at 09:11 AM in C++ Programming

avatar image

Doberman_0
16 2 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Sounds like inheriting from UObject should be enough.

more ▼

answered Aug 21 '18 at 10:47 AM

avatar image

Manoel.Neto
132 2 3 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

DataTable class sounds most similar but you probablt can just extend UObject like Manoel said

more ▼

answered Aug 26 '18 at 01:07 AM

avatar image

mightyenigma
3.8k 18 20 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question