00001 /* *********************************************************************************** 00002 Writer: Sebastien Bloc 00003 Copyright: 2003-2004 00004 eMail: sebastien.bloc@free.fr 00005 URL: http://mignonsoft.free.fr 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 as published by the Free Software Foundation; either version 2 00010 of the License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 http://www.gnu.org/copyleft/gpl.html 00017 *********************************************************************************** */ 00018 00023 #ifndef INCLUDE_INERTIA_H 00024 #define INCLUDE_INERTIA_H 00025 00026 #include "windows.h" 00027 #include "MyList.h" 00028 #include "input.h" 00029 00034 class ElemStack 00035 { 00036 public: 00037 Point2D<int> elem; 00038 double timing; 00039 00040 void operator=(ElemStack &src) 00041 { 00042 elem = src.elem; 00043 timing = src.timing; 00044 } 00045 }; 00046 00072 class Inertia: public has_slots<> 00073 { 00074 private: 00075 MyStack<ElemStack> stack; 00076 Timer timer; 00077 double viewTime; 00078 double inertiaTime; 00079 00080 public: 00081 Inertia(); 00082 void Start(double _viewTime=0.5,double _inertiaTime=0.1); 00083 void Add(Point2D<int> element); 00084 Point2D<double> GetMoyValue(); 00085 }; 00086 00087 class Control; 00088 00092 class EventInertia : public has_slots<> 00093 { 00094 private: 00095 StateMouse *mouseState; 00096 Point2D<double> mousePos; 00097 int numButton; 00098 Timer timer; 00099 int face; 00100 Point2D<double> vectorInertia; 00101 00102 public: 00103 BOOL enable; 00104 00105 EventInertia(); 00106 void operator=(EventInertia &src); 00107 void Init(int _numButton); 00108 void Start(int _face,Point2D<double> _vectorInertia); 00109 void Stop(); 00110 void SwitchButton(); 00111 int OnInertia(Timer *timer); 00112 }; 00113 00114 #endif