C
C#3y ago
Oli

Any way to declare these variables more efficiently?

Just curious as it doesnt look too clean
6 Replies
Saber
Saber3y ago
Create classes so you don't have to duplicate the variables.
sparr
sparr3y ago
Elaborating on the above, I think they are suggesting that P1 and P2 should both be instances of a "Player" class, and THAT class would have just five copies of this unclean code pattern instead of the ten you hve now.
Oli
OliOP3y ago
yeah ive just realised i dont need the DefNames
sparr
sparr3y ago
How would you make properties of those new classed properties be private or public at the level of this class?
Oli
OliOP3y ago
i have this class for the player
Oli
OliOP3y ago
instead of using P1DefName should i do Team1.Name or smth
Want results from more Discord servers?
Add your server