Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Interface Entity
- {
- ??
- }
- Interface IComponent
- {
- public void SetBehaviour(IBehaviour);
- public void Update();
- }
- Interface IPositionComponent : IComponent
- {
- ???
- }
- class PositionCompnent : IPositionComponent
- {
- public void Update()
- {
- }
- }
- Interface IDrawComponent : PositionComponent
- {
- }
- interface IBehaviour
- {
- //Properties...
- }
- class BunnyPositionBehaviour : IBehaviour
- {
- //....
- }
- class BunnyDrawBehaviour : IBehaviour
- {
- //....
- }
- class Bunny : ?
- {
- }
- void main()
- {
- Bunny bigBunny = new Bunny();
- bigBunny.AddComponent( new DrawComponent());
- bigBunny.GetComponent("DrawComponent").SetBehaviour(BunnyDrawBehaviour);
- bigBUnny.GetComponent("PositionComponent").SetBehaviour(BunnyPositionBehaviour);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement