For my coding project in c# I must create a program that uses multiple forms. Mine is an RPG character creator that will simply have the user select traits and stats, and then display them on the final form/screen. Given that, I've decided to create a Character class. The traits and stats are on different forms/screen so I create a UserCharacter object from the Character class and when they select "Next" it would add the traits to the properties of the Character object and would do the same on the second part of the creation(adding the stats). My question is how would I set the properties of the UserCharacter object that was created in one form, on the following?
On the next button click I have this
Character UserCharacter = new Character();
SetCharacterProperties(UserCharacter);
this.Hide();
CharacterCreationScreen2 OpenCharacterCreationScreen2 = new CharacterCreationScreen2();
OpenCharacterCreationScreen2.ShowDialog();
this.Close();
This sets the first half of the Character Properties and then I open the next form. On the next form I have the stats which I would use a similar method to add those properties to an object, if possible I would like to add them to the UserCharacter created on the previous screen. Which I would then access a last time on the final form/screen to display the properties added.
If I use the method to open a new form instance for example:
CharacterCreationScreen1 AccessCharacterCreationScreen1 = new CharacterCreationScreen1();
I am able to use the SetCharacterProperties method, but not access the UserCharacter object.