animpoint.cpp
author insilmaril
Wed Feb 27 16:09:06 2008 +0000 (2008-02-27)
changeset 673 234b4900dfa8
child 688 d0086df58648
permissions -rw-r--r--
autosave fix
     1 #include "animpoint.h"
     2 
     3 AnimPoint::AnimPoint()
     4 {
     5 	init();
     6 }
     7 
     8 void AnimPoint::operator= ( const AnimPoint & other )
     9 {
    10 	copy (other);
    11 }
    12 
    13 void AnimPoint::operator= ( const QPointF & other )
    14 {
    15 	init();
    16 	setX (other.x() );
    17 	setY (other.x() );
    18 }
    19 
    20 bool AnimPoint::operator== ( const QPointF& other )
    21 {
    22 	QPointF p( x(),y());
    23 	return p == other;
    24 }
    25 
    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;
    31 
    32 	return true;
    33 }
    34 
    35 void AnimPoint::init ()
    36 {
    37 	animated=false;
    38 }
    39 
    40 void AnimPoint::copy (AnimPoint other)
    41 {
    42 	setX (other.x() );
    43 	setY (other.x() );
    44 	animated=other.animated;
    45 }
    46 
    47 
    48 void AnimPoint::setDest(const QPointF &p)
    49 {
    50 	destPos=p;
    51 }
    52 
    53 void AnimPoint::setAnimated(bool b)
    54 {
    55 	animated=b;
    56 }
    57 
    58 bool AnimPoint::isAnimated()
    59 {
    60 	return animated;
    61 }
    62 
    63 void AnimPoint::animate()
    64 {
    65 	setX (x()+1);
    66 	setY (y()+1);
    67 }
    68 
    69 
    70