-
Notifications
You must be signed in to change notification settings - Fork 6
/
BFPresentationDispatch.m
139 lines (115 loc) · 3.99 KB
/
BFPresentationDispatch.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
//
// BFPresentationController.m
// Briefs
//
// Created by Rob Rhyne on 8/4/09.
// Copyright Digital Arch Design, 2009. See LICENSE file for details.
//
#import "BFPresentationDispatch.h"
#import "SynthesizeSingleton.h"
@implementation BFPresentationDispatch
@synthesize viewController;
SYNTHESIZE_SINGLETON_FOR_CLASS(BFPresentationDispatch);
///////////////////////////////////////////////////////////////////////////////
#pragma mark -
#pragma mark Singleton Accessor Methods
+ (id<BFLocalActionDispatch>)sharedLocalDispatch
{
return (id<BFLocalActionDispatch>) [BFPresentationDispatch sharedBFPresentationDispatch];
}
+ (id<BFGlobalActionDispatch>)sharedGlobalDispatch
{
return (id<BFGlobalActionDispatch>) [BFPresentationDispatch sharedBFPresentationDispatch];
}
///////////////////////////////////////////////////////////////////////////////
#pragma mark -
#pragma mark Local Dispatch Methods
- (void)gotoScene:(int)indexOfScene
{
if (self.viewController != nil) {
if ([self.viewController willLoadSceneWithIndex:indexOfScene] == false)
// TODO: throw exception
NSLog(@"Throw an exception, because the scene did not load!");
else {
NSLog(@"Scene %d was just loaded", indexOfScene);
}
}
}
- (void)gotoScene:(int)indexOfScene usingTransition:(NSString *)transition
{
if (self.viewController != nil) {
if ([self.viewController willLoadSceneWithIndex:indexOfScene usingTransition:transition] == false)
// TODO: throw exception
NSLog(@"Throw an exception, because the scene did not load!");
else {
NSLog(@"Scene %d was just loaded using the transition %@", indexOfScene, transition);
}
}
}
- (void)toggleActor:(int)indexOfActor
{
if (self.viewController != nil) {
if ([self.viewController willToggleActorWithIndex:indexOfActor] == false)
// TODO: throw exception
NSLog(@"Throw an exception, because the actor was not toggled!");
else {
NSLog(@"Actor %d was just toggled", indexOfActor);
}
}
}
- (void)show:(int)indexOfActor
{
if (self.viewController != nil) {
if ([self.viewController willShowActorWithIndex:indexOfActor] == false)
// TODO: throw exception
NSLog(@"Throw an exception, because the actor was not shown!");
else {
NSLog(@"Actor %d is now showing.", indexOfActor);
}
}
}
- (void)hide:(int)indexOfActor
{
if (self.viewController != nil) {
if ([self.viewController willHideActorWithIndex:indexOfActor] == false)
// TODO: throw exception
NSLog(@"Throw an exception, because the actor was not hidden!");
else {
NSLog(@"Actor %d was just hidden", indexOfActor);
}
}
}
- (void)resize:(int)indexOfActor withSize:(CGSize)size
{
if (self.viewController != nil) {
if ([self.viewController willResizeActorWithIndex:indexOfActor toSize:size] == false)
// TODO: throw exception
NSLog(@"Throw an exception, because I was not able to resize the actor!");
else {
NSLog(@"Resized Actor %d, to the size %@", indexOfActor, NSStringFromCGSize(size));
}
}
}
- (void)move:(int)indexOfActor toPoint:(CGPoint)point
{
if (self.viewController != nil) {
if ([self.viewController willMoveActorWithIndex:indexOfActor toPoint:point] == false)
// TODO: throw exception
NSLog(@"Throw an exception, because I was not able to move the actor");
else {
NSLog(@"Moved Actor %d, to the point %@", indexOfActor, NSStringFromCGPoint(point));
}
}
}
///////////////////////////////////////////////////////////////////////////////
#pragma mark -
#pragma mark Global Dispatch Methods
- (void)toggleKeyboard:(NSString *)type {
// TODO: toggle keyboard in current view
}
///////////////////////////////////////////////////////////////////////////////
- (void)dealloc
{
[super dealloc];
}
@end