-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnemyInputClass.cs
More file actions
228 lines (198 loc) · 7.86 KB
/
Copy pathEnemyInputClass.cs
File metadata and controls
228 lines (198 loc) · 7.86 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ASCIIMazeCS;
using System.Threading;
//==================================//
//Changed Code Block Begin
//==================================//
//namespace AiRogueLike
//{
// class EnemyInputClass : ASCIIMazeCS.InputClass
// {
// private InputClass inputClass;
// private Coord<int, int> topLeft;
// private Coord<int, int> bottomRight;
// private Thread thread;
// private bool alive = true;
// private int movementSpeed = 500;
// private EnemyData enemyData;
// public EnemyInputClass(Coord<int, int> initPos, int MaxX, int MaxY, InputClass ic, Coord<int, int> topLeft,
// Coord<int, int> bottomRight)
// : base(initPos, MaxX, MaxY)
// {
// Random r = new Random(42);
// this.enemyData = GameLib.enemies[r.Next(0, GameLib.enemies.Count)];
// this.inputClass = ic;
// this.topLeft = topLeft;
// this.bottomRight = bottomRight;
// CharacterSymbol = enemyData.MapView.ToString();
// thread = new Thread(new ThreadStart(Run));
// thread.Start();
// }
// public EnemyInputClass(EnemyInputClass e) : base(e.Position, e.MaxX, e.MaxY)
// {
// this.enemyData = e.EnemyData;
// this.inputClass = e.InputClass;
// this.topLeft = e.TopLeft;
// this.bottomRight = e.BottomRight;
// CharacterSymbol = "E";
// thread = new Thread(new ThreadStart(Run));
// if (Position.XPos < 60 && Position.YPos < 35 &&
// Position.XPos > 0 && Position.YPos > 0)
// {
// Console.SetCursorPosition(Position.XPos, Position.YPos);
// Console.ForegroundColor = GameLib.colors[2];
// Console.Write(CharacterSymbol + " ");
// }
// thread.Start();
// }
// public void Start()
// {
// // if(!thread.IsAlive)
// // thread.Start();
// if (Position.XPos < 60 && Position.YPos < 35 &&
// Position.XPos > 0 && Position.YPos > 0)
// {
// Console.SetCursorPosition(Position.XPos, Position.YPos);
// Console.ForegroundColor = GameLib.colors[2];
// Console.Write(CharacterSymbol + " ");
// }
// }
// public void Stop()
// {
// if(thread.IsAlive)
// thread.Abort();
// }
// public override bool collisionDetect(char dir)
// {
// return base.collisionDetect(dir);
// }
// public void Run()
// {
// while (alive)
// {
// getInput();
// if (Position.XPos == inputClass.Position.XPos &&
// Position.YPos == inputClass.Position.YPos)
// {
// Console.Clear();
// BattleMechanics bm = new BattleMechanics();
// GameLib.curState = GameLib.GameState.Battle;
// bm.startBattle(this.enemyData);
// alive = false;
// Console.SetCursorPosition(Position.XPos, Position.YPos);
// Console.Write("X");
// this.Position = new Coord<int, int>(0, 0);
// break;
// }
// Thread.Sleep(movementSpeed);
// }
// }
// public new void getInput()
// {
// //Player is in the boundries of the vincinity...
// if ((this.inputClass.Position.XPos >= topLeft.XPos && this.inputClass.Position.XPos <=
// bottomRight.XPos) && (this.inputClass.Position.YPos >= this.topLeft.YPos &&
// this.inputClass.Position.YPos <= bottomRight.YPos))
// {
// // Going to the left...
// if (inputClass.Position.XPos < this.Position.XPos)
// {
// if (!collisionDetect('a'))
// {
// Position.XPos--;
// if (Position.XPos < 0)
// Position.XPos = 0;
// Console.SetCursorPosition(Position.XPos, Position.YPos);
// Console.ForegroundColor = GameLib.colors[2];
// Console.Write(CharacterSymbol + " ");
// }
// }
// // Going down...
// if (inputClass.Position.YPos > this.Position.YPos)
// {
// if (!collisionDetect('s'))
// {
// Position.YPos++;
// if (Position.YPos > MaxY)
// Position.YPos = MaxY;
// Console.SetCursorPosition(Position.XPos, Position.YPos);
// Console.ForegroundColor = GameLib.colors[2];
// Console.Write(CharacterSymbol);
// //Position.YPos--;
// Console.SetCursorPosition(Position.XPos, Position.YPos - 1);
// Console.Write(" ");
// //Position.YPos++;
// }
// }
// // Going right...
// if (inputClass.Position.XPos > this.Position.XPos)
// {
// if (!collisionDetect('d'))
// {
// Position.XPos++;
// if (Position.XPos > MaxX)
// Position.XPos = MaxX;
// Console.SetCursorPosition(Position.XPos - 1, Position.YPos);
// Console.ForegroundColor = GameLib.colors[2];
// Console.Write(" ");
// Console.SetCursorPosition(Position.XPos, Position.YPos);
// Console.Write(CharacterSymbol);
// }
// }
// //Going up.
// if (inputClass.Position.YPos < this.Position.YPos)
// {
// if (!collisionDetect('w'))
// {
// Position.YPos--;
// if (Position.YPos < 0)
// Position.YPos = 0;
// Console.SetCursorPosition(Position.XPos, Position.YPos);
// Console.ForegroundColor = GameLib.colors[2];
// Console.Write(CharacterSymbol);
// Position.YPos++;
// Console.SetCursorPosition(Position.XPos, Position.YPos);
// Console.Write(" ");
// Position.YPos--;
// }
// }
// else
// {
// }
// Console.ForegroundColor = ConsoleColor.White;
// }
// }
// public void Destory()
// {
// thread.Abort();
// this.Position = new Coord<int, int>(0, 0);
// this.CharacterSymbol = " ";
// }
// public bool Alive
// {
// get { return alive; }
// }
// public InputClass InputClass
// {
// get { return inputClass; }
// }
// public Coord<int, int> TopLeft
// {
// get { return topLeft; }
// }
// public Coord<int, int> BottomRight
// {
// get { return bottomRight; }
// }
// public EnemyData EnemyData
// {
// get { return enemyData; }
// }
// }
//}
//==================================//
//Changed Code Block End
//==================================//