With my code, I'm trying to identify and draw a cypher pattern.
Here are the pieces of my code's structure that are relevant to my question,
"
OnStateChange()
{
int PatternID = 0;
}
OnBarUpdate()
{
if (*potential cypher conditions met*) //use new bar to identify potential new patterns
{
PatternID = PatternID+1;
*Draw pattern with tag = "potentialcypher"+PatternID*
}
for (int i=1;PatternID;++i) //iterate through old potential patterns to update completion status
{
if (*cypher pattern broken*)
{
*remove drawings with tag = "potentialcypher"+i*
}
}
}
"
I identify potential cypher patterns as they get close to completion. I want to remove old patterns that never complete; this is why I have the for loop to iterate through old patterns.
I'm getting an error in the line with "PatternID = PatternID+1;" saying that PatternID does not exist in current context. Any idea why? Do I have to re-declare the integer in OnBarUpdate?
Thank you!
Comment