Hello :)
i found a need of properties in a Area class
public List<Tile> Tiles { get; set; }
private int _goldValue;
public int GoldValue
{
get
{
sum = 0;
foreach (Tile t in Tiles)
{
sum += t.Surface.GoldValue;
}
return sum;
}
}
well - something wierd... i didn't needed the private _goldValue.. actually i can delete it and everything will be just fine.
am i missing something? the GoldValue public i want the Area's object will have - get it's value from the List of Tiles...
1. leave the private _goldValue just for the good practice?
2. delete the private _goldValue, and just leave the public one? (it's just dont feels right...)
3. there is a better way to do such a thing? (am i missing something?)
thank u!