Created
July 29, 2012 01:00
-
-
Save chancez/3195546 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool Queue::enqueue(const Potion& aPotion) | |
{ | |
if (size == MAX_CAPACITY) | |
return false; //Returns false if the queue is full | |
//Add the item to the end of the queue | |
items[rear] = aPotion; | |
rear = (rear + 1) % MAX_CAPACITY; //Circular, so no shifting needed. | |
size++; | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment