-
-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathmovement_info.cpp
38 lines (30 loc) · 897 Bytes
/
movement_info.cpp
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
#include "stdafx.h"
#include "movement_info.h"
MovementInfo::MovementInfo(Vec2 dir, LocalTime begin, LocalTime end, int moveCnt, MovementInfo::Type t)
: dirX(dir.x), dirY(dir.y), tBegin(begin.getDouble()), tEnd(end.getDouble()), type(t), moveCounter(moveCnt) {}
MovementInfo::MovementInfo() {
}
MovementInfo& MovementInfo::setDirection(Vec2 v) {
dirX = v.x;
dirY = v.y;
return *this;
}
MovementInfo& MovementInfo::setType(MovementInfo::Type t) {
type = t;
return *this;
}
MovementInfo& MovementInfo::setMaxLength(TimeInterval i) {
tEnd = min<float>(tEnd, tBegin + i.getDouble());
return *this;
}
MovementInfo& MovementInfo::setVictim(UniqueEntity<Creature>::Id id) {
victim = id.getGenericId();
return *this;
}
MovementInfo& MovementInfo::setFX(optional<FXVariantName> v) {
fx = v;
return *this;
}
Vec2 MovementInfo::getDir() const {
return Vec2(dirX, dirY);
}