Viewmodel

VM has only 2 variables whose updates trigger function updates.

Health Variable
MaxHealth Variable

Functions must always have only one return value, and must also have the attributes: pure and const. Two examples are given below.

GetPercent() Properties
IsAlive() Properties

The following is the content of the functions, for a better understanding of this example.

GetPercent()
GetInvertedPercent()
IsVisible()
IsAlive()
IsDead()
IsFull()

Last updated