mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-30 21:42:59 +00:00 
			
		
		
		
	hook deletion
This commit is contained in:
		
							
								
								
									
										10
									
								
								hyper.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								hyper.h
									
									
									
									
									
								
							| @@ -458,9 +458,13 @@ public: | ||||
|             prio++; | ||||
|         } | ||||
|         map_->emplace(prio, static_cast<U&&>(hook)); | ||||
|         return 0; | ||||
|         return prio; | ||||
|     } | ||||
|  | ||||
|     void del(int prio) { | ||||
|         map_->erase(prio); | ||||
|         } | ||||
|  | ||||
|     template<class... U> | ||||
|     void callhooks(U&&... args) const { | ||||
|         if (map_ == nullptr) return; | ||||
| @@ -709,6 +713,10 @@ template<class T, class U> int addHook(hookset<T>& m, int prio, U&& hook) { | ||||
|   return m.add(prio, static_cast<U&&>(hook)); | ||||
|   } | ||||
|  | ||||
| template<class T> void delHook(hookset<T>& m, int prio) { | ||||
|   m.del(prio); | ||||
|   } | ||||
|  | ||||
| template<class T, class... U> void callhooks(const hookset<T>& h, U&&... args) { | ||||
|   return h.callhooks(static_cast<U&&>(args)...); | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue