25-09-2011, 16:13
|
|
|
חבר מתאריך: 17.03.02
הודעות: 2,354
|
|
זה מה שעשיתי במחלקה BasketballTeam, נסה לעשות את אותו הדבר (כמובן עם הבדיקה של התיקו..) ב-FootballTeam:
קוד:
public int Score {
get {
int scoreCount = 0;
for (int i = 0; i < GamesArray.Length; i++) {
if (GamesArray[i].Guest_Team_ID == this.Team_ID) {
if (GamesArray[i].Guest_Goals > GamesArray[i].Host_Goals)
scoreCount += 2;
}
else {
if (GamesArray[i].Host_Goals > GamesArray[i].Guest_Goals)
scoreCount += 2;
}
}
return scoreCount;
}
}
|