Advertisement
Guest User

Untitled

a guest
Sep 21st, 2014
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. public int addCreature(Creature newCreature) {
  2.  
  3. increaseArray();
  4.  
  5. if (findCreature(newCreature.getName()) != null) {
  6. return -1;
  7. }
  8.  
  9. // assume increaseArray() increases by one
  10. // and the new element is empty...
  11. creatureList[creatureList.length] = newCreature;
  12. return creatureList.length;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement