Vultraz

Untitled

Apr 26th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. template<typename T>
  2. class display_context_proxy
  3. {
  4. private:
  5.     using proxy_ref_t = typename utils::const_clone<display_context, T>::type
  6.  
  7.     template<typename S>
  8.     using getter_t = typename utils::const_clone<S, proxy_ref_t>::type;
  9.  
  10. public:
  11.     explicit display_context_proxy(proxy_ref_t& dc) : dc_(dc) {}
  12.     virtual ~display_context_proxy();
  13.  
  14.     getter_t<std::vector<team>>& teams() const
  15.     {
  16.         return dc_.teams();
  17.     }
  18.  
  19.     getter_t<gamemap>& map() const
  20.     {
  21.         return dc_.map();
  22.     }
  23.  
  24.     getter_t<unit_map>& units() const
  25.     {
  26.         return dc_.units();
  27.     }
  28.  
  29.     getter_t<team>& get_team(int side) const
  30.     {
  31.         return dc_.get_team(side);
  32.     }
  33.  
  34. private:
  35.     proxy_ref_t& dc_;
  36. };
Advertisement
Add Comment
Please, Sign In to add comment