我不知道如何在我的 user.cs 类中存储玩家的平均分数、高分和完成游戏的平均时间。每当玩家完成我的一轮游戏时,平均分和最高分以及平均时间都必须在他们的标签中每次更新。
我试过使用数组和数组列表,但我仍然不确定,因为它们似乎都不起作用。
这是我的 user.cs 类:
public class User
{
public string fname { get; set; } = "";
public string lname { get; set; } = "";
public string username { get; set; } = "";
public string password { get; set; } = "";
public User() { }
public User (string fname, string lname, string username, string password)
{
this.fname = fname;
this.lname = lname;
this.username = username;
this.password = password;
}
}
我还需要在标签中显示用户名、用户名、高分、平均分和时间。
格式应为双精度/浮点数。
MYYA
梦里花落0921
相关分类