Gerard-Meier

TODO decorators

Apr 22nd, 2012
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. In Empty.cpp (de decorator superclass is dit) moet een methode komen die makkelijk kan controleren of er al een gameobject op een bepaalde positie staat. Dus als wij straks de decorators gaan maken kunnen wij zo iets doen:
  2.  
  3. // NB: gameObjects is a Json array.
  4. if(isPositionAvailable(gameObjects, 23, 23, 23)) {
  5.     gameObjects.Insert("starship", 23, 23, 23);
  6. } else {
  7.     // recalculate a new random position, and try again.
  8. }
Advertisement
Add Comment
Please, Sign In to add comment