Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Check if StickerSheet has maximum amount of stickers allotted
- if (count_ == maxStickers_) {
- return -1;
- }
- //Iterate through array of stickers
- for (unsigned i = 0; i < maxStickers_; i++) {
- //Check for first existance of sticker, index of this denoted by "i"
- if (!stickerExists_[i]) {
- stickers_[i] = new Image(sticker); //Create a sticker copy from the reference parameter
- xCoord_[i] = x; //Copy x-coord
- yCoord_[i] = y; //Copy y-coord
- stickerExists_[i] = true; //Update sticker exists value
- //Check if current index is greater than or equal to the highest free slot
- return i;
- }
- }
- return -1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement