-
Notifications
You must be signed in to change notification settings - Fork 0
/
Envelope.cpp
89 lines (65 loc) · 1.64 KB
/
Envelope.cpp
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
// Envelope.cpp: implementation of the Envelope class.
//
//////////////////////////////////////////////////////////////////////
//#include "stdafx.h"
#include "Envelope.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Envelope::Envelope()
{
}
Envelope::~Envelope()
{
}
Envelope::Envelope(vector<xy> input)
{
}
Envelope::Envelope(xy* input, int length)
{
int x = 0 ;
xy tempxy ;
for (x=0 ; x < length; x++)
{
tempxy.x = (float) (input->x) ;
tempxy.y = (float) (input->y) ;
input++ ;
_xyData.push_back( tempxy ) ;
}
}
int Envelope::EnterEnvelopeData( void )
{
xy tempxy ;
cout << endl ;
cout << " This is single side of envelope - other is mirror image" << endl ;
cout << " |" << endl ;
cout << " 100| ___" << endl ;
cout << " | / \\ " << endl ;
cout << " | / \\___ " << endl ;
cout << " |/ \\ " << endl ;
cout << " 0|_____________\\___ " << endl ;
cout << " 0 100 "<< endl ;
char input = 'y' ;
while ( input == 'y' )
{
cout << "Attack (xy range 0-100)" << endl << "x: " ;
cin.clear(0) ;
cin >> tempxy.x ;
cout << "y: " ;
cin.clear(0) ;
cin >> tempxy.y ;
cout << "Enter Another? (y/n)" ;
cin.clear(0) ;
cin >> input ;
//input = cin.
if ((input == 'n') || (input == 'N'))
{
cout << "true!" ;
}
else
input = 'y' ;
cin.clear(0) ;
_xyData.push_back( tempxy ) ;
}
return _xyData.size() ;
}