1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
|
//Bunny.h
#include <string.h>
using namespace std;
static char* NameArr[] =
{
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z"
};
static char* SexArr[] =
{
"MALE",
"FEMALE"
};
static char* ColorArr[] =
{
"WHITE",
"BLACK",
"SPOTTED",
"BROWN"
};
typedef enum t_Name
{
A = 0, // 0
B, // 1
C, // 2
D, // 3
E, // 4
F, // 5
G, // 6
H, // 7
I, // 8
J, // 9
K, // 10
L, // 11
M, // 12
N, // 13
O, // 14
P, // 15
Q, // 16
R, // 17
S, // 18
T, // 19
U, // 20
V, // 21
W, // 22
X, // 23
Y, // 24
Z, // 25
MAX_NAME // 26
};
typedef enum t_Sex
{
MALE = 0, // 0
FEMALE, // 1
MAX_SEX // 2
};
typedef enum t_Color
{
WHITE = 0, // 0
BLACK, // 1
SPOTTED, // 2
BROWN, // 3
MAX_COLOR // 4
};
class Rabbit
{
public:
//Constructor
Rabbit();
//Destructor
~Rabbit();
//Get Function
char* GetName() {return NameArr[Name];}
char* GetColor() {return ColorArr[Color];}
char* GetSex() {return SexArr[Sex];}
int GetAge() {return Age;}
bool GetEvil() {return RadioActive;}
t_Name MyNameIs() {return Name;}
t_Color MyColorIs() {return Color;}
t_Sex MySexuality() {return Sex;}
//Set Function
void SetName(t_Name NewName);
void SetColor(t_Color NewColor);
void SetSex(t_Sex NewSex);
void SetAge(int age);
void BeEvil(bool Demon);
//Main functionalities
void GetOld();
void Die();
void TurnVampire();
void Print();
int Count();
void IAmGod(); //Kill off half of the population //Power of God
//Point to next Rabbit
Rabbit* Next;
private:
t_Name Name;
t_Color Color;
t_Sex Sex;
int Age;
bool RadioActive;
};
|