Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. public interface ILocalModel<Local, Remote>
  2. where Remote : IRemoteModel<Remote, Local>
  3. where Local : ILocalModel<Local, Remote>
  4. {
  5. Remote GetRemoteModel();
  6.  
  7. }
  8.  
  9. public interface IRemoteModel<Remote, Local>
  10. where Local : ILocalModel<Local, Remote>
  11. where Remote : IRemoteModel<Remote, Local>
  12. {
  13. Local GetLocalModel();
  14. }
  15.  
  16. public class Hero : ILocalModel<Hero, HeroData>
  17. {
  18. // Fields and other stuff ...
  19.  
  20. public HeroData GetRemoteModel()
  21. {
  22. }
  23. }
  24.  
  25. public struct HeroData : IRemoteModel<HeroData, Hero>
  26. {
  27.  
  28. // Fields and other stuff ...
  29.  
  30. public Hero GetLocalModel()
  31. {
  32.  
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement