-
Notifications
You must be signed in to change notification settings - Fork 0
/
Win.h
executable file
·67 lines (44 loc) · 1.96 KB
/
Win.h
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
#ifndef WIN_H
#define WIN_H
#include <iostream>
using namespace std;
const int youngest_mating_age = 3; //youngest age before different genders will view each other as potential mates
const int max_life_expectancy = 10; //maximum number of years (iterations) a win can live through
const int fight_threshold = 5; //threshold combativeness must exceed before a win chooses to fight
const int trait_range = 10; //maximum value any given trait can have
const int mutation_range = 3; //degree to which a trait can change from a single mutation
//following odds calculated as "X-1 in X chance" of outcome occuring (ex: 10 => 9 in 10 chance of outcome)
const int gender_bias = 2; //likelihood child inherets the 'A' gender when mating
const int ease_of_childbirth = 10; //likelihood of living through childbirth
const int gene_stability = 5; //likelihood that child will not have a mutatation during conception
class win {
public:
//constructors
win();
win(int strength,
int speed,
char gender,
int combativeness,
int mating_selectivity_strength,
int mating_selectivity_speed);
win(const win& w);
friend ostream& operator<<(ostream& os, win& w);
friend win mate(win& w1, win& w2);
friend bool fight(win& w1, win& w2);
bool potential_mate(win& w2);
bool attack(win& w2);
bool alive();
bool grow_older();
private:
bool isAlive;
int age;
//physique
int strength;
int speed;
char gender;
//personality
int combativeness; //propensity to fight with respect to other win's strength
int mating_selectivity_strength; //acceptable deviation from own strength in potential mate
int mating_selectivity_speed; //acceptable deviation from own speed in potential mate
};
#endif