2020-03-17 16:12:23 +00:00
|
|
|
#include <Array.h>
|
2020-03-29 17:34:08 +00:00
|
|
|
#include "ui/event.h"
|
|
|
|
#include "ui/garray.h"
|
2020-03-17 16:12:23 +00:00
|
|
|
|
|
|
|
@implementation Array (Group)
|
|
|
|
- (void) makeObjectsPerformSelector: (SEL)selector
|
|
|
|
if: (condition_func)condition
|
|
|
|
with: (void *)data
|
|
|
|
{
|
|
|
|
for (int i = 0; i < [self count]; i++) {
|
|
|
|
if (condition (_objs[i], data)) {
|
|
|
|
[_objs[i] performSelector: selector];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) makeObjectsPerformSelector: (SEL)selector
|
|
|
|
withObject: (void *)anObject
|
|
|
|
if: (condition_func2)condition
|
|
|
|
with: (void *)data
|
|
|
|
{
|
|
|
|
for (int i = 0; i < [self count]; i++) {
|
|
|
|
if (condition (_objs[i], anObject, data)) {
|
|
|
|
[_objs[i] performSelector: selector withObject: anObject];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) makeReversedObjectsPerformSelector: (SEL)selector
|
|
|
|
{
|
|
|
|
for (int i = [self count]; i-->0; ) {
|
|
|
|
[_objs[i] performSelector: selector];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) makeReversedObjectsPerformSelector: (SEL)selector
|
|
|
|
withObject: (void *)anObject
|
|
|
|
{
|
|
|
|
for (int i = [self count]; i-->0; ) {
|
|
|
|
[_objs[i] performSelector: selector withObject: anObject];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) makeReversedObjectsPerformSelector: (SEL)selector
|
|
|
|
if: (condition_func)condition
|
|
|
|
with: (void *)data
|
|
|
|
{
|
|
|
|
for (int i = [self count]; i-->0; ) {
|
|
|
|
if (condition (_objs[i], data)) {
|
|
|
|
[_objs[i] performSelector: selector];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) makeReversedObjectsPerformSelector: (SEL)selector
|
|
|
|
withObject: (void *)anObject
|
|
|
|
if: (condition_func2)condition
|
|
|
|
with: (void *)data
|
|
|
|
{
|
|
|
|
for (int i = [self count]; i-->0; ) {
|
|
|
|
if (condition (_objs[i], anObject, data)) {
|
|
|
|
[_objs[i] performSelector: selector withObject: anObject];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@end
|