| 
									
										
										
										
											2018-05-08 20:03:29 +08:00
										 |  |  |  | #include "..\e2daction.h"
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | e2d::Delay::Delay(double duration) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	_delay = max(duration, 0); | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | e2d::Delay * e2d::Delay::clone() const | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	return new Delay(_delay); | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | void e2d::Delay::_init() | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	Action::_init(); | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | void e2d::Delay::_update() | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	Action::_update(); | 
					
						
							|  |  |  |  | 	// <20>ж<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>㹻
 | 
					
						
							| 
									
										
										
										
											2018-05-09 00:34:15 +08:00
										 |  |  |  | 	if ((Time::getTotalTime() - _last) >= _delay) | 
					
						
							| 
									
										
										
										
											2018-05-08 20:03:29 +08:00
										 |  |  |  | 	{ | 
					
						
							|  |  |  |  | 		this->stop(); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | } |