basically i have 5 stoplights and when user changes the from red to green i clear all images of that stop light with the clearLights function but since I have 5 stoplights i created 5 ClearLights Functions, is there a way to just have one and pass the integer of through so I can change visibility of the correct stoplight?
this code works, i just know there is got to be a better way to do it, combining 5 functions into one OO one
Code:
private void ClearLights0()
{
GreenLight0.Visible=false;
YellowLight0.Visible = false;
RedLight0.Visible = false;
}
private void ClearLights1()
{
GreenLight1.Visible=false;
YellowLight1.Visible = false;
RedLight1.Visible = false;
}
etc...