9

Improving C++ Code Quality

Congratulations, you have completed eight chapters and have made the game playable! But do you notice something in the C++ code you wrote that makes you feel uncomfortable – for example, the duplicated variables and functions in the APlayerAvatar and AEnemy classes? This chapter will introduce two approaches (code refactoring and code refinement) that developers regularly use to improve their code quality.

Additionally, you will also learn how to output debug messages in Unreal and two ways (by calling the Cast and IsA functions) to find out an actor’s class type.

By the end of this chapter, you will have a valuable awareness of the importance of maintaining code quality in programming, as well as knowledge regarding ...

Get Unreal Engine 5 Game Development with C++ Scripting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.