mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 14:20:59 +00:00
[qwaq] Split Array(Group) into its own file
This commit is contained in:
parent
0293d335d0
commit
e5bc6dd8b6
3 changed files with 67 additions and 63 deletions
|
@ -26,6 +26,7 @@ SUFFIXES=.o .r
|
|||
qwaq_app_dat_src= \
|
||||
qwaq-app.r \
|
||||
qwaq-draw.r \
|
||||
qwaq-garray.r \
|
||||
qwaq-group.r \
|
||||
qwaq-rect.r \
|
||||
qwaq-screen.r \
|
||||
|
|
66
ruamoko/qwaq/qwaq-garray.r
Normal file
66
ruamoko/qwaq/qwaq-garray.r
Normal file
|
@ -0,0 +1,66 @@
|
|||
#include <Array.h>
|
||||
#include "event.h"
|
||||
#include "qwaq-group.h"
|
||||
|
||||
@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
|
|
@ -2,69 +2,6 @@
|
|||
#include "event.h"
|
||||
#include "qwaq-group.h"
|
||||
|
||||
@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
|
||||
|
||||
@implementation Group
|
||||
|
||||
-initWithContext: (id) context
|
||||
|
|
Loading…
Reference in a new issue