-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGunFactory.h
More file actions
43 lines (32 loc) · 995 Bytes
/
GunFactory.h
File metadata and controls
43 lines (32 loc) · 995 Bytes
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
#pragma once
#include "Factory.h"
#include <iostream>
using namespace std;
#define DEFAULT_GUN_CALIBER 7.62 //êàëèáð
#define DEFAULT_GUN_AMMO_CAPACITY 6 //êîë-âî ïàòðîíîâ
class GunFactory : public Factory {
double gunCaliber;
int gunAmmoCapacity;
public:
GunFactory() : Factory() {
gunCaliber = DEFAULT_GUN_CALIBER;
gunAmmoCapacity = DEFAULT_GUN_AMMO_CAPACITY;
}
GunFactory(string* name, int workersCount, double workerEfficiency, double gunCaliber, int gunAmmoCapacity)
: Factory(name, workersCount, workerEfficiency) {
setGunCaliber(gunCaliber);
setGunAmmoCapacity(gunAmmoCapacity);
}
~GunFactory() {}
//êîíñòðóêòîð êîïèð ê áàçîâîìó êëàññó
GunFactory(const GunFactory& obj) : Factory(obj) {
setGunCaliber(obj.gunCaliber);
setGunAmmoCapacity(obj.gunAmmoCapacity);
}
void setGunCaliber(double);
void setGunAmmoCapacity(int);
double getGunCaliber();
int getGunAmmoCapacity();
void print();
void produceGuns();
};