euclidthegame / euclidthegame-iOS

Ipad version of Euclid: The Game
euclidthegame.com
1 stars 0 forks source link

repeated well done messages #22

Closed kasperpeulen closed 10 years ago

kasperpeulen commented 10 years ago

I think it would be better to not repeat well done messages, if object are drawn twice

I think the most easy way to fix this is, to disable drawing the same object again, this would also fix overlapping points labels.

Something like this seems to work:

- (void)addGeometricObjects:(NSArray*)objects_
{
    NSMutableArray* tempobjects = [[NSMutableArray alloc]initWithArray:objects_];
    for (id newobject in objects_) {
        for (id oldobject in _geometricObjects) {
            if (EqualCircles(oldobject, newobject) || EqualLines(oldobject, newobject) || EqualLineSegments(oldobject, newobject)|| EqualPoints(oldobject, newobject)){
                [tempobjects removeObject:newobject];
            }
        }
    }
    NSArray* objects = [[NSArray alloc] initWithArray:tempobjects];

I'm not sure if I'm doing a little bit too much here. I'm a little bit a noob with arrays don't see the reason why some arrays are mutable and some are not, I don't see what the downside is of having an array mutable.

kasperpeulen commented 10 years ago

pushed to master now