Hello again.
I have a property 'F' in class 'Club'. I realized that it doesn't function properly while going through debugging and locals. At first look it had normal, wanted values.
BUT than every time I hovered over class->property F it increased by *2 or seomthing like that.
Here's the code:
class formation
{
private int[] frm = new int[7];
private int def, dmf, sb, smf, mid, amf, st;
public int[] Formation
{
get {
frm[0] = Sb;
frm[1] = Def;
frm[2] = Dmf;
frm[3] = Smf;
frm[4] = Mid;
frm[5] = Amf;
frm[6] = St;
return frm;
}
}
public int Smf
{
get { return smf; }
set { smf = value; }
}
public int Sb
{
get { return sb; }
set { sb = value; }
}
public int St
{
get { return st; }
set {
st = value;
}
}
public int Amf
{
get { return amf; }
set {
amf = value;
}
}
public int Mid
{
get { return mid; }
set {
mid = value;
}
}
public int Dmf
{
get { return dmf; }
set {
dmf = value;
}
}
public int Def
{
get { return def; }
set {
def = value;
}
}
}
//////////////////////////////////////
class Club
{
private formation f = new formation();
public formation F
{
get
{
for (int i = 0; i <= 10; i++)
{
switch (PlayersBL[i].Position)
{
case "SB":
f.Sb++; break;
case "DC":
f.Def++; break;
case "DMC":
f.Dmf++; break;
case "SMF":
f.Smf++; break;
case "MC":
f.Mid++; break;
case "AMC":
f.Amf++; break;
case "ST":
f.St++; break;
}
}
return f;
}
}
}
/////////////////////////
private void someFunction() {
foreach (Club club in mainForm.League)
{
if (club.Id == mainForm.UserClub.Id)
{
continue;
}
else
{
selectPlayerForFirst11("GK",club);
selectPlayerForFirst11("SB", club);
selectPlayerForFirst11("DC", club);
selectPlayerForFirst11("DMC", club);
selectPlayerForFirst11("SMF", club);
selectPlayerForFirst11("MC", club);
selectPlayerForFirst11("AMC", club);
selectPlayerForFirst11("ST", club);
}
}
}