我有一个我实例化Character
的类的对象数组( )Player
Form1
我需要以另一种形式(Combat
)使用这些对象,但我不确定如何传递它们。这是我尝试过的:
public partial class Form1: Form
private void combatBtn_Click(object sender, EventArgs e)
{
Form combat = new Combat(Character[0-9]);
combat.ShowDialog();
}
public partial class Combat : Form
{
Player[] character = new Player[9];
public Combat(Player chars[0-9])
{
InitializeComponent();
for (int i = 0; i > 9; i++)
{
character[i] = chars[i];
}
}