Any way to declare these variables more efficiently?
Just curious as it doesnt look too clean
![](https://utfs.io/f/f5953c7d-098c-40ed-b6c6-a18d8d2747d3-4pl4mu.png)
6 Replies
Create classes so you don't have to duplicate the variables.
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.
yeah ive just realised i dont need the DefNames
How would you make properties of those new classed properties be private or public at the level of this class?
i have this class for the player
![](https://utfs.io/f/6e83d219-f1b4-475b-8316-e6f74f8ddfc6-4pl4mu.png)
instead of using P1DefName should i do Team1.Name or smth