Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. Interface Entity
  2. {
  3. ??
  4. }
  5.  
  6. Interface IComponent
  7. {
  8.     public void SetBehaviour(IBehaviour);
  9.     public void Update();
  10. }
  11. Interface IPositionComponent : IComponent
  12. {
  13.     ???
  14. }
  15.  
  16. class PositionCompnent : IPositionComponent
  17. {
  18.     public void Update()
  19.     {
  20.        
  21.     }
  22. }
  23.  
  24. Interface IDrawComponent : PositionComponent
  25. {
  26.    
  27. }
  28.  
  29. interface IBehaviour
  30. {
  31.     //Properties...
  32. }
  33.  
  34. class BunnyPositionBehaviour : IBehaviour
  35. {
  36.     //....
  37. }
  38.  
  39. class BunnyDrawBehaviour : IBehaviour
  40. {
  41.     //....
  42. }
  43.  
  44. class Bunny : ?
  45. {
  46.    
  47. }
  48.  
  49. void main()
  50. {
  51.     Bunny bigBunny = new Bunny();
  52.     bigBunny.AddComponent( new DrawComponent());
  53.     bigBunny.GetComponent("DrawComponent").SetBehaviour(BunnyDrawBehaviour);
  54.     bigBUnny.GetComponent("PositionComponent").SetBehaviour(BunnyPositionBehaviour);
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement