This is what I was able to recognize

In the .cpp file:

  • There is a #include of the header file of course.
  • We have 3 functions: a constructor and 2 void ones. All belong to the class that we’ve created.
  • In the constructor we set the boolean bCanEverTick which is a part of the PrimaryComponentTick struct to true.
  • In BeginPlay() we have a namespace “Super” which contains a function called BeginPlay().
  • The last function takes 3 arguments: a float (which is like a double but takes up less memory), an enum (for some reason not an enum class), and a pointer to FActorComponentTickFunction which is also a struct. This function also uses the “Super” namespace, through which we call the TickComponent function and pass all 3 arguments as arguments to it.

In the .h file:

  • We have our classical #pragma once and some header files included which I don’t recognize.
  • There are 3 macros: UCLASS, BUILDINGESCAPE_API, GENERATED_BODY().
  • The class is publically inheriting from UActorComponent.
  • It also contains all 3 access specifiers (public, protected and private).
  • In protected and private there are virtual functions which are used in polymorphism, though I don’t know what override means (will have to Google it).

That’s pretty much it.

1 Like

in the .h file you failed to notice that there are two public keywords and no private. I’m taking that they did this to separate the initialization and the every frames, but may be used outside the .cpp file. From my basic understanding.

The amount of stuff I noticed was super minimal, (beginner coding)!

A constructor after he mentioned it.
Pretty much general things people use to write code example: ;, {}, //, #include of the header file, void not returning a value, function::operator()…

Need to touch up review again.

Privacy & Terms