2010-09-30 19:03:48 +00:00
|
|
|
//
|
|
|
|
// TouchLocation.m
|
|
|
|
// XNI
|
|
|
|
//
|
|
|
|
// Created by Matej Jan on 29.9.10.
|
|
|
|
// Copyright 2010 Retronator. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "TouchLocation.h"
|
|
|
|
|
|
|
|
|
|
|
|
@implementation TouchLocation
|
|
|
|
|
2010-10-01 02:36:21 +00:00
|
|
|
- (id) initWithIdentifier:(int)theIdentifier position:(Vector2*)thePosition
|
|
|
|
previousPosition:(Vector2*)thePreviousPosition state:(TouchLocationState)theState;
|
|
|
|
{
|
|
|
|
self = [super init];
|
|
|
|
if (self != nil) {
|
|
|
|
identifier = theIdentifier;
|
|
|
|
position = [thePosition retain];
|
|
|
|
previousPosition = [thePreviousPosition retain];
|
|
|
|
state = theState;
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
@synthesize identifier;
|
2010-09-30 19:03:48 +00:00
|
|
|
@synthesize position;
|
|
|
|
@synthesize state;
|
|
|
|
|
2010-10-01 02:36:21 +00:00
|
|
|
- (BOOL) tryGetPreviousPosition:(Vector2**)thePeviousPosition {
|
|
|
|
if (previousPosition) {
|
|
|
|
*thePeviousPosition = previousPosition;
|
|
|
|
return YES;
|
|
|
|
} else {
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) dealloc
|
|
|
|
{
|
|
|
|
[position release];
|
|
|
|
[previousPosition release];
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-09-30 19:03:48 +00:00
|
|
|
@end
|