author | insilmaril |
Mon, 22 Oct 2007 09:50:09 +0000 | |
changeset 610 | ff98aee6fb99 |
parent 461 | b0d72eb511c9 |
child 688 | d0086df58648 |
permissions | -rw-r--r-- |
1 #include "animpoint.h"
3 AnimPoint::AnimPoint()
4 {
5 init();
6 }
8 void AnimPoint::operator= ( const AnimPoint & other )
9 {
10 copy (other);
11 }
13 void AnimPoint::operator= ( const QPointF & other )
14 {
15 init();
16 setX (other.x() );
17 setY (other.x() );
18 }
20 bool AnimPoint::operator== ( const QPointF& other )
21 {
22 QPointF p( x(),y());
23 return p == other;
24 }
26 bool AnimPoint::operator== ( AnimPoint other )
27 {
28 if (rx() != other.rx() ) return false;
29 if (ry() != other.ry() ) return false;
30 if (animated != other.animated ) return false;
32 return true;
33 }
35 void AnimPoint::init ()
36 {
37 animated=false;
38 }
40 void AnimPoint::copy (AnimPoint other)
41 {
42 setX (other.x() );
43 setY (other.x() );
44 animated=other.animated;
45 }
48 void AnimPoint::setDest(const QPointF &p)
49 {
50 destPos=p;
51 }
53 void AnimPoint::setAnimated(bool b)
54 {
55 animated=b;
56 }
58 bool AnimPoint::isAnimated()
59 {
60 return animated;
61 }
63 void AnimPoint::animate()
64 {
65 setX (x()+1);
66 setY (y()+1);
67 }