Skip to content

Instantly share code, notes, and snippets.

@mauritslamers
Created May 30, 2009 15:55
Show Gist options
  • Save mauritslamers/120534 to your computer and use it in GitHub Desktop.
Save mauritslamers/120534 to your computer and use it in GitHub Desktop.
#import <AudioToolbox/AudioToolbox.h>
#import <AVFoundation/AVFoundation.h>
@interface CheckPoint : NSObject {
NSMutableArray *Filenames;
// iets met spelers
NSMutableArray *Volume;
NSMutableArray *Players;
BOOL playersInitialized;
CLLocation* Position;
double Margin;
double volume_step_size;
}
@property (readonly, nonatomic) CLLocation* Position;
-(id)initWithLatitude:(float)latitude:(float)longitude:(float)margin;
-(void)setFilenames:(NSArray*)fnames;
-(void)setVolume:(int)PlayerNumber:(float)volume;
-(void)setAllVolumes:(float)volume;
@end
#import "CheckPoint.h"
@implementation CheckPoint
@synthesize Position;
-(id)initWithLatitude:(float)latitude:(float)longitude:(float)margin{
if(self = [super init]){
// constructor
Position = [[CLLocation alloc] initWithLatitude:latitude longitude:longitude];
Margin = margin;
}
return self;
}
#import <Foundation/Foundation.h>
@class CheckPoint;
@interface Connection : NSObject {
CLLocationCoordinate2D* fromLocationCoordinate;
CLLocationCoordinate2D* toLocationCoordinate;
CheckPoint* fromCheckPoint;
CheckPoint* toCheckPoint;
float Margin;
}
-(id)initWithCheckPointsFrom:(CheckPoint*)from:(CheckPoint*)to:(float)margin;
-(void)processCoordinate:(CLLocation*)newLocation; // a pointer to a location object??
-(void)performAction:(CLLocation*)newLocation;
-(void)performNeutral;
@end
#import "CheckPoint.h"
#import "Connection.h"
@implementation Connection
-(id)initWithCheckPointsFrom:(CheckPoint*)from:(CheckPoint*)to:(float)margin{
if(self = [super init]){
fromCheckPoint = from;
toCheckPoint = to;
Margin = margin;
fromLocationCoordinate = fromCheckPoint.Position.coordinate;
}
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment