Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

CSC112 Spring 2016 Examples

2369 views
1
/*
2
* File: alpacaFracasPack.h
3
* Purpose: This is a class for containing a pack of attack alapacas who will be
4
* fighting to the death in an alpaca fracas.
5
*/
6
#ifndef ALPACAFRACASPACK_H
7
#define ALPACAFRACASPACK_H
8
#include <vector>
9
#include "alpaca.h"
10
#define MAX_POINTS 600
11
#define MAX_ALPACAS 15
12
13
class AlpacaFracasPack
14
{
15
public:
16
AlpacaFracasPack();
17
~AlpacaFracasPack();
18
19
//returns the name of the pack
20
virtual std::string name()=0;
21
22
//Removes the first alpaca from the pack and returns it. Returns null if there is no alpaca
23
Alpaca *unload();
24
25
//Adds an alpaca to the pack returns true on success and false if this alpaca would push
26
//the points limit over the max points ormax alpacas
27
bool load(Alpaca *a);
28
29
//returns the number of remaining alpacas
30
int packSize();
31
32
//returns the number of remaining power points in the pack
33
unsigned int power();
34
35
//returns the power points at the time of pack creation
36
unsigned int originalPower();
37
38
//allows access to the alpacas in the pack note that this does not return by reference.
39
//you cannot change the alpacas around!
40
Alpaca * operator[](unsigned int i);
41
42
private:
43
std::vector<Alpaca*> alpacaList;
44
unsigned int packPower;
45
};
46
47
#endif
48