File tree Expand file tree Collapse file tree 2 files changed +644
-681
lines changed Expand file tree Collapse file tree 2 files changed +644
-681
lines changed Original file line number Diff line number Diff line change 1+ #ifndef  unnatural_uwapi_scripts_hpp_zhgfa8g4
2+ #define  unnatural_uwapi_scripts_hpp_zhgfa8g4 
3+ 
4+ #include  < vector> 
5+ 
6+ #include  " scripts.h" 
7+ 
8+ namespace  uw 
9+ {
10+ 	template <class  T >
11+ 	auto  makeVector (T *data, uint32 cnt)
12+ 	{
13+ 		std::vector<std::remove_cv_t <T>> res;
14+ 		res.resize (cnt);
15+ 		memcpy (res.data (), data, cnt * sizeof (T));
16+ 		return  res;
17+ 	}
18+ 
19+ 	template <class  S >
20+ 	requires (requires  { S::data; })
21+ 	auto  makeVector (const  S *src)
22+ 	{
23+ 		return  makeVector (src->data , src->count );
24+ 	}
25+ 
26+ 	inline  auto  makeVector (const  UwIds &ids)
27+ 	{
28+ 		return  makeVector (ids.ids , ids.count );
29+ 	}
30+ 
31+ 	inline  auto  allEntities ()
32+ 	{
33+ 		UwIds ids;
34+ 		uwAllEntities (&ids);
35+ 		return  makeVector (ids);
36+ 	}
37+ }
38+ 
39+ #endif  //  unnatural_uwapi_scripts_hpp_zhgfa8g4
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments