-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOrbitalStructure.m
64 lines (47 loc) · 1.26 KB
/
OrbitalStructure.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// OrbitalStructure.m
// GraceWorld
//
// Created by John Detloff on 4/27/13.
// Copyright (c) 2013 Uebie. All rights reserved.
//
#import "OrbitalStructure.h"
#import "OrbitalSurface.h"
#import "OrbitalRect.h"
@implementation OrbitalStructure {
NSMutableArray *_orbitalSurfaces;
NSMutableArray *_sensorSurfaces;
NSMutableArray *_orbitalRects;
}
- (id)init {
self = [super init];
if (self) {
_activated = YES;
_orbitalSurfaces = [[NSMutableArray alloc] init];
_orbitalRects = [[NSMutableArray alloc] init];
_sensorSurfaces = [[NSMutableArray alloc] init];
}
return self;
}
#pragma mark -
- (void)setActivated:(BOOL)activated {
if (_activated != activated) {
_activated = activated;
for (OrbitalSurface *surface in _orbitalSurfaces) {
surface.activated = _activated;
}
}
}
- (void)addOrbitalSurfaces:(NSArray *)orbitalSurfaces {
for (OrbitalSurface *surface in orbitalSurfaces) {
surface.activated = _activated;
[_orbitalSurfaces addObject:surface];
}
}
- (void)addSensorSurface:(OrbitalSurface *)surface {
[_sensorSurfaces addObject:surface];
}
- (void)addOrbitalRect:(OrbitalRect *)rect {
[_orbitalRects addObject:rect];
}
@end