I have a school group project this semester and we have to create a Fantasy Football Mock Draft in Visual C#.
I am thinking that the best way to manage each player's stats is by creating an object class called "Player" or something similar. Then, create an array like so:
I know how to use basic variables for the object, things like:
and so forth...
But what I would really like to do is be able to use things like:
In other words, have "categories" for certain variables, and be able to create and use variables as a subset of said categories. Is this even possible in C#? I tried Googling a few things, but since I don't really know the correct terminology to search for, I am having trouble finding any answers. How would I go about creating these variables in this manner?
Thanks in advance for anyone who can shed some light on this.
I am thinking that the best way to manage each player's stats is by creating an object class called "Player" or something similar. Then, create an array like so:
Code:
Player myPlayer[] = new Player[100]; //arbitrarily picked 100
I know how to use basic variables for the object, things like:
Code:
myPlayer[5].Name = "Joe Schmoe";
myPlayer[5].Position = "QB";
But what I would really like to do is be able to use things like:
Code:
myPlayer[5].Passing.Yards = 150;
myPlayer[5].Passing.TDs = 1;
myPlayer[5].Rushing.Yards = 48;
myPlayer[5].Rushing.TDs = 2;
In other words, have "categories" for certain variables, and be able to create and use variables as a subset of said categories. Is this even possible in C#? I tried Googling a few things, but since I don't really know the correct terminology to search for, I am having trouble finding any answers. How would I go about creating these variables in this manner?
Thanks in advance for anyone who can shed some light on this.
