Advertisement
Guest User

Untitled

a guest
Jul 31st, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. public class Entity
  2. {
  3.     public List<IComponent> Components { get; set; }
  4.    
  5.     public Entity()
  6.     {
  7.         Components = new List<IComponent>();
  8.     }
  9.  
  10.     public void Update(float elapsed)
  11.     {
  12.         foreach(var c in Components)
  13.         {
  14.             c.Update(elapsed);
  15.         }
  16.     }
  17.  
  18.     // BLA BLA BLA ADD COMPONENT GETCOMPONENT<T> REMOVECOMPONENT<T> BLA BLA BLA
  19. }
  20.  
  21. public interface IComponent
  22. {
  23.     void Update(float elapsed);
  24.     // BLA BLA ETC BLA BLA
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement