-
Notifications
You must be signed in to change notification settings - Fork 1
/
EntityAction.m
37 lines (30 loc) · 962 Bytes
/
EntityAction.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
//
// EntityAction.m
// CowardlyRogue
//
// Created by David Dovel on 4/12/14.
// Copyright (c) 2014 QBobble. All rights reserved.
//
#import "EntityAction.h"
@implementation EntityAction
- (id)initWithActionType:(EntityActionType)type startPosition:(CGPoint)startPosition targetPosition:(CGPoint)targetPosition target:(Entity *)target
{
if ((self = [super init]))
{
self.actionType = type;
self.startPosition = startPosition;
self.targetPosition = targetPosition;
self.target = target;
}
return self;
}
- (id)initWithActionType:(EntityActionType)type target:(Entity *)target
{
return [self initWithActionType:type startPosition:CGPointZero targetPosition:CGPointZero target:target];
}
- (id)initWithStartPosition:(CGPoint)startPosition targetPosition:(CGPoint)targetPosition
{
//defaults to move
return [self initWithActionType:kEntityActionTypeMove startPosition:startPosition targetPosition:targetPosition target:nil];
}
@end