Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 29th, 2012  |  syntax: None  |  size: 0.57 KB  |  views: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. class idFireable{
  2.         void doFired();
  3. }
  4.  
  5. class idProjectile{
  6.         doFired(){
  7.                 // the projectile is fired in the aimed direction
  8.         }
  9. }
  10.  
  11. class idDecorator{
  12.         fireable* idFireable;
  13.        
  14.         idDecorator(idFireable fireable){
  15.                 this.fireable = fireable;
  16.         }
  17.        
  18.         override doFired(){
  19.                 fireable.doFired();
  20.         }
  21. }
  22.  
  23. class idGuided{
  24.         object* guidedObjectRepresentation = null;
  25.        
  26.         idGuided(idFireabloe fireable){
  27.                 super(fireable);
  28.         }
  29.  
  30.         override doFired(){
  31.                 doAdditionalFired();
  32.                 super.doFired();
  33.         }
  34.        
  35.         void doAdditionalFired(){
  36.                 // Add enemy locking and guiding
  37.         }
  38. }
clone this paste RAW Paste Data