So, I'm starting a web development course at septemeber, and we're going to program in C #. So I started to study it, so I have some experience with this. Now I have ~ 2 years of experience in HTML, CSS and PHP, so I immediately chose C #.
I study classes, and I study, not read. I decided to create a small console RPG for learning classes. I have a main game, but I have a problem. I am trying to display the inventory of players from the Player class in another class.
I use the List to store players βinventory.
public List<string> inventory = new List<string>();
This is in the player class file.
Then in the store class I do:
Player player = new Player();
To create a new object to access the player class. Then, to add something to the list in the store, I do:
player.inventory.Add("Axe");
player.inventory(); , - System.Collections.Generic.List`1 [System.String].
-, ? ?