| 
									
										
										
										
											2018-04-21 21:24:46 +08:00
										 |  |  |  | #include "..\e2dmanager.h"
 | 
					
						
							|  |  |  |  | #include "..\e2daction.h"
 | 
					
						
							| 
									
										
										
										
											2018-05-24 00:58:16 +08:00
										 |  |  |  | #include "..\e2dnode.h"
 | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | e2d::ActionManager * e2d::ActionManager::_instance = nullptr; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | e2d::ActionManager * e2d::ActionManager::getInstance() | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	if (!_instance) | 
					
						
							|  |  |  |  | 		_instance = new (std::nothrow) ActionManager; | 
					
						
							|  |  |  |  | 	return _instance; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | void e2d::ActionManager::destroyInstance() | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	if (_instance) | 
					
						
							|  |  |  |  | 	{ | 
					
						
							|  |  |  |  | 		delete _instance; | 
					
						
							|  |  |  |  | 		_instance = nullptr; | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | e2d::ActionManager::ActionManager() | 
					
						
							|  |  |  |  | 	: _actions() | 
					
						
							|  |  |  |  | 	, _runningActions() | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | e2d::ActionManager::~ActionManager() | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | } | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 22:05:23 +08:00
										 |  |  |  | void e2d::ActionManager::update() | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	if (_runningActions.empty() || Game::getInstance()->isPaused()) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 		return; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	// ѭ<><D1AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еĶ<D0B5><C4B6><EFBFBD>
 | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	for (size_t i = 0; i < _runningActions.size(); ++i) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 		auto action = _runningActions[i]; | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 		// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
 | 
					
						
							| 
									
										
										
										
											2018-07-07 01:43:41 +08:00
										 |  |  |  | 		if (action->_isDone()) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2018-07-07 01:43:41 +08:00
										 |  |  |  | 			GC::release(action); | 
					
						
							| 
									
										
										
										
											2018-05-08 20:03:29 +08:00
										 |  |  |  | 			action->_target = nullptr; | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 			_runningActions.erase(_runningActions.begin() + i); | 
					
						
							| 
									
										
										
										
											2018-03-11 23:56:40 +08:00
										 |  |  |  | 		} | 
					
						
							|  |  |  |  | 		else | 
					
						
							|  |  |  |  | 		{ | 
					
						
							|  |  |  |  | 			if (action->isRunning()) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 			{ | 
					
						
							|  |  |  |  | 				// ִ<>ж<EFBFBD><D0B6><EFBFBD>
 | 
					
						
							|  |  |  |  | 				action->_update(); | 
					
						
							|  |  |  |  | 			} | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-08 20:03:29 +08:00
										 |  |  |  | void e2d::ActionManager::__add(Action * action) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  |  | 	if (action) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 		auto iter = std::find(_actions.begin(), _actions.end(), action); | 
					
						
							|  |  |  |  | 		if (iter == _actions.end()) | 
					
						
							|  |  |  |  | 		{ | 
					
						
							|  |  |  |  | 			_actions.push_back(action); | 
					
						
							|  |  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 	} | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-08 20:03:29 +08:00
										 |  |  |  | void e2d::ActionManager::__remove(Action * action) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	if (_actions.empty() || action == nullptr) | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		return; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	auto iter = std::find(_actions.begin(), _actions.end(), action); | 
					
						
							|  |  |  |  | 	if (iter != _actions.end()) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 		_actions.erase(iter); | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 	} | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | void e2d::ActionManager::resumeAllBindedWith(Node * target) | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	if (_runningActions.empty() || target == nullptr) | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		return; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	for (auto action : _runningActions) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		if (action->getTarget() == target) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 			action->resume(); | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 		} | 
					
						
							|  |  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | void e2d::ActionManager::pauseAllBindedWith(Node * target) | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	if (_runningActions.empty() || target == nullptr) | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		return; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	for (auto action : _runningActions) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		if (action->getTarget() == target) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 			action->pause(); | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 		} | 
					
						
							|  |  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | void e2d::ActionManager::stopAllBindedWith(Node * target) | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	if (_runningActions.empty() || target == nullptr) | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		return; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	for (auto action : _runningActions) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		if (action->getTarget() == target) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 			action->stop(); | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 	} | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-08 20:03:29 +08:00
										 |  |  |  | void e2d::ActionManager::start(Action * action, Node * target, bool paused) | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-08 20:03:29 +08:00
										 |  |  |  | 	WARN_IF(action == nullptr, "Action NULL pointer exception!"); | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  |  | 	WARN_IF(target == nullptr, "Target node NULL pointer exception!"); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	if (action && target) | 
					
						
							|  |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-05-24 12:24:39 +08:00
										 |  |  |  | 		if (action->_target == nullptr) | 
					
						
							|  |  |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 			auto iter = std::find(_runningActions.begin(), _runningActions.end(), action); | 
					
						
							|  |  |  |  | 			if (iter == _runningActions.end()) | 
					
						
							| 
									
										
										
										
											2018-05-24 12:24:39 +08:00
										 |  |  |  | 			{ | 
					
						
							| 
									
										
										
										
											2018-07-07 01:43:41 +08:00
										 |  |  |  | 				GC::retain(action); | 
					
						
							| 
									
										
										
										
											2018-05-24 12:24:39 +08:00
										 |  |  |  | 				action->_startWithTarget(target); | 
					
						
							|  |  |  |  | 				action->_running = !paused; | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 				_runningActions.push_back(action); | 
					
						
							| 
									
										
										
										
											2018-05-24 12:24:39 +08:00
										 |  |  |  | 			} | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 		else | 
					
						
							|  |  |  |  | 		{ | 
					
						
							|  |  |  |  | 			throw Exception(L"<EFBFBD><EFBFBD> Action <20><><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>Ŀ<EFBFBD><C4BF>"); | 
					
						
							|  |  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  |  | 	} | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | void e2d::ActionManager::resume(const String& name) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	if (_runningActions.empty() || name.isEmpty()) | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		return; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	for (auto action : _runningActions) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		if (action->getName() == name) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 		{ | 
					
						
							|  |  |  |  | 			action->resume(); | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | void e2d::ActionManager::pause(const String& name) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	if (_runningActions.empty() || name.isEmpty()) | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		return; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	for (auto action : _runningActions) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		if (action->getName() == name) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 			action->pause(); | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | void e2d::ActionManager::stop(const String& name) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	if (_runningActions.empty() || name.isEmpty()) | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		return; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	for (auto action : _runningActions) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		if (action->getName() == name) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 		{ | 
					
						
							|  |  |  |  | 			action->stop(); | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 		} | 
					
						
							|  |  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | void e2d::ActionManager::clearAllBindedWith(Node * target) | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  |  | 	if (target) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 		for (size_t i = 0; i < _runningActions.size();) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 			auto a = _runningActions[i]; | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  |  | 			if (a->getTarget() == target) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 			{ | 
					
						
							| 
									
										
										
										
											2018-07-06 00:47:50 +08:00
										 |  |  |  | 				GC::safeRelease(a); | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 				_runningActions.erase(_runningActions.begin() + i); | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 			} | 
					
						
							|  |  |  |  | 			else | 
					
						
							|  |  |  |  | 			{ | 
					
						
							| 
									
										
										
										
											2018-05-14 22:51:40 +08:00
										 |  |  |  | 				++i; | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 			} | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 22:05:23 +08:00
										 |  |  |  | void e2d::ActionManager::clearAll() | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-07-21 22:57:21 +08:00
										 |  |  |  | 	if (!_runningActions.empty()) | 
					
						
							| 
									
										
										
										
											2017-10-21 19:09:31 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-07-21 22:57:21 +08:00
										 |  |  |  | 		for (auto action : _runningActions) | 
					
						
							|  |  |  |  | 		{ | 
					
						
							|  |  |  |  | 			GC::release(action); | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 		_runningActions.clear(); | 
					
						
							| 
									
										
										
										
											2017-10-21 19:09:31 +08:00
										 |  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-07-21 22:57:21 +08:00
										 |  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2018-07-05 22:05:23 +08:00
										 |  |  |  | 	_actions.clear(); | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | std::vector<e2d::Action*> e2d::ActionManager::get(const String& name) | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-10 00:58:43 +08:00
										 |  |  |  | 	std::vector<Action*> actions; | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	for (auto action : _actions) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-05-22 00:11:57 +08:00
										 |  |  |  | 		if (action->getName() == name) | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2018-05-10 00:58:43 +08:00
										 |  |  |  | 			actions.push_back(action); | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-05-10 00:58:43 +08:00
										 |  |  |  | 	return std::move(actions); | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-10 14:16:36 +08:00
										 |  |  |  | const std::vector<e2d::Action*>& e2d::ActionManager::getAll() | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	return _actions; | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-05 22:05:23 +08:00
										 |  |  |  | void e2d::ActionManager::updateTime() | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-07-05 01:09:54 +08:00
										 |  |  |  | 	for (auto action : _runningActions) | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2018-03-06 09:56:17 +08:00
										 |  |  |  | 		action->_resetTime(); | 
					
						
							| 
									
										
										
										
											2017-10-19 12:48:58 +08:00
										 |  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2017-10-19 00:50:04 +08:00
										 |  |  |  | } |