namespace map {
Entity::Entity()
-: animation(0)
+: follower(0)
+, animation(0)
, orientation(ORIENTATION_NORTH)
, speed(0) {
runner.SetFrameShift(1);
UpdateVelocity();
}
+void Entity::StartAnimation(app::Application &ctrl) {
+ runner.Start(ctrl);
+}
+
+void Entity::StartAnimation(app::State &ctrl) {
+ runner.Start(ctrl);
+}
+
+void Entity::StopAnimation() {
+ runner.Stop();
+}
+
+void Entity::AddFollower(Entity *f) {
+ if (follower) {
+ follower->AddFollower(f);
+ } else {
+ follower = f;
+ }
+}
+
+void Entity::RemoveFollower(Entity *f) {
+ if (follower == f) {
+ follower = follower->follower;
+ } else if (follower) {
+ follower->RemoveFollower(f);
+ }
+}
+
void Entity::SetAnimation(const graphics::Animation *a) {
animation = a;
runner.ChangeAnimation(animation);