Why make a function for the action point cost, instead of a protected variable?

Hi, I was just wondering why you went with a virtual function to return the cost of Action Points, when we could simply go with a protected int on the BaseAction ?

1 Like

It’s a matter of preference. If I remember correctly Hugo said he prefers to use functions as getters and setters.

1 Like

There are many paths to the same result.

1 Like

If you make it a protected int you are enabling both read and write access. Whereas with a Get function you limit that to only read access.

2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms