Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int addCreature(Creature newCreature) {
- increaseArray();
- if (findCreature(newCreature.getName()) != null) {
- return -1;
- }
- // assume increaseArray() increases by one
- // and the new element is empty...
- creatureList[creatureList.length] = newCreature;
- return creatureList.length;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement