-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
146 lines (105 loc) · 4.25 KB
/
Program.cs
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
using System.Drawing.Text;
using ExternalRPM.Buff;
using ExternalRPM.Data;
using ExternalRPM.Model;
using ExternalRPM.Model.Kindred;
using ExternalRPM.Modules;
using ExternalRPM.Presentation;
using System.Threading.Tasks;
using SharpDX;
using System.Diagnostics;
using WindowsInput;
using WindowsInput.Native;
using System.Runtime.InteropServices;
namespace ExternalRPM
{
public class Program
{
public static Presentation.Overlay overlay; // = new Presentation.Overlay();
static void Main()
{
//Release();
UnitRadiusService.ParseUnitRadiusData();
Mediator mediator = new Mediator();
CosmicSurfer.Walk();
InputSimulator simulator = new InputSimulator();
var champions = ChampionReader.ReadChampions();
List<Offsets.GameObject> enemyChampionsList = new List<Offsets.GameObject>();
foreach (var champion in champions)
{
if (champion.TeamID != champions[0].TeamID)
{
enemyChampionsList.Add(champion);
}
}
Offsets.GameObject[] enemyChampions = enemyChampionsList.ToArray();
while (true)
{
for (int i = 0; i < enemyChampions.Length; i++)
{
enemyChampions[i].Position = ChampionReader.ReadChampionPosition(enemyChampions[i].memoryID);
Renderer.WorldToScreen(enemyChampions[i].Position, out enemyChampions[i].ScreenPosition);
}
Debug.WriteLine($"{enemyChampions[0].ScreenPosition}");
Thread.Sleep(5000);
}
CosmicSurfer.Walk();
overlay = new Presentation.Overlay(mediator);
Task.Run(async () =>
{
await Task.Run(() => overlay.Show());
}).GetAwaiter().GetResult();
/*
while (true)
{
(Matrix viewMatrix, Matrix projectionMatrix) = Renderer.GetMatrices();
//Debug.WriteLine($"View X: {viewMatrix.M41}, Y: {viewMatrix.M42}, Z: {viewMatrix.M43}");
Vector3 screenPosition;
var w2s = Renderer.WorldToScreen(localPlayer.GetPosition(), out screenPosition);
//Thread.Sleep(1000);
}
*/
//var matrix = Renderer.GetViewMatrix();
//var projMatrix = Renderer.GetProjectionMatrix();
}
public static void Release()
{
Mediator mediator = new Mediator();
overlay = new Presentation.Overlay(mediator);
Task.Run(async () =>
{
await Task.Run(() => overlay.Show());
}).GetAwaiter().GetResult();
}
public static void MainLoop()
{
Dictionary<string, JungleCamp> jungleCamps = JungleCamp.InitializeJungleCamps();
LocalPlayer localPlayer = LocalPlayer.GetInstance();
KindredTracker kindredTracker = new KindredTracker(new List<JungleCamp>(jungleCamps.Values), localPlayer);
CommandLineUI commandLineUI = new CommandLineUI(new List<JungleCamp>(jungleCamps.Values).ToArray(), kindredTracker);
commandLineUI.StartCountdownThreads();
HashSet<string> camps = new HashSet<string>();
EntityReader memoryReader = new EntityReader();
while (true)
{
camps = memoryReader.GetJungleCampsEntityList();
foreach (JungleCamp jungleCamp in jungleCamps.Values)
{
jungleCamp.HandleEntityListChange(camps);
}
kindredTracker.UpdateMarkStatus();
Thread.Sleep(1000);
}
while (true)
{
camps = memoryReader.GetJungleCampsEntityList();
foreach (JungleCamp jungleCamp in jungleCamps.Values)
{
jungleCamp.HandleEntityListChange(camps);
}
kindredTracker.UpdateMarkStatus();
Thread.Sleep(1000);
}
}
}
}