| 
									
										
										
										
											2017-10-19 12:47:36 +08:00
										 |  |  | #include "..\eactions.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  | e2d::EActionLoop::EActionLoop(EAction * action) : | 
					
						
							| 
									
										
										
										
											2017-10-19 12:47:36 +08:00
										 |  |  | 	m_Action(action) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	m_Action->retain(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  | e2d::EActionLoop::~EActionLoop() | 
					
						
							| 
									
										
										
										
											2017-10-19 12:47:36 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-10-21 19:09:31 +08:00
										 |  |  | 	SafeReleaseAndClear(&m_Action); | 
					
						
							| 
									
										
										
										
											2017-10-19 12:47:36 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  | e2d::EActionLoop * e2d::EActionLoop::clone() const | 
					
						
							| 
									
										
										
										
											2017-10-19 12:47:36 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  | 	return new EActionLoop(m_Action->clone()); | 
					
						
							| 
									
										
										
										
											2017-10-19 12:47:36 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  | void e2d::EActionLoop::_init() | 
					
						
							| 
									
										
										
										
											2017-10-19 12:47:36 +08:00
										 |  |  | { | 
					
						
							|  |  |  | 	EAction::_init(); | 
					
						
							| 
									
										
										
										
											2017-10-20 00:59:26 +08:00
										 |  |  | 	if (!m_Action->getTarget() && m_pTarget) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		m_Action->setTarget(m_pTarget); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2017-10-19 12:47:36 +08:00
										 |  |  | 	m_Action->_init(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  | void e2d::EActionLoop::_callOn() | 
					
						
							| 
									
										
										
										
											2017-10-19 12:47:36 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  | 	m_Action->_callOn(); | 
					
						
							| 
									
										
										
										
											2017-10-19 12:47:36 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  | 	if (m_Action->_isEnding()) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:47:36 +08:00
										 |  |  | 	{ | 
					
						
							|  |  |  | 		m_Action->_reset(); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  | void e2d::EActionLoop::_reset() | 
					
						
							| 
									
										
										
										
											2017-10-19 12:47:36 +08:00
										 |  |  | { | 
					
						
							|  |  |  | 	EAction::_reset(); | 
					
						
							|  |  |  | } |