You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

MainWindow.xaml.cs 49 kB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. using System.Diagnostics;
  16. using System.Windows.Threading;
  17. using Grpc.Core;
  18. using Protobuf;
  19. // 目前MainWindow还未复现的功能:
  20. // 部分errordisplayer
  21. // private void ReactToCommandline(),
  22. // private void Playback(string fileName, double pbSpeed = 2.0)
  23. // 交互:private void ClickToSetMode(object sender, RoutedEventArgs e)
  24. // private void Bonus()
  25. namespace Client
  26. {
  27. /// <summary>
  28. /// Interaction logic for MainWindow.xaml
  29. /// </summary>
  30. public partial class MainWindow : Window
  31. {
  32. public MainWindow()
  33. {
  34. unitHeight = unitWidth = unit = 13;
  35. bonusflag = true;
  36. timer = new DispatcherTimer
  37. {
  38. Interval = new TimeSpan(50000) // 每50ms刷新一次
  39. };
  40. timer.Tick += new EventHandler(Refresh); // 定时器初始化
  41. InitializeComponent();
  42. timer.Start();
  43. SetStatusBar();
  44. isClientStocked = true;
  45. isPlaybackMode = false;
  46. drawPicLock = new();
  47. listOfProp = new List<MessageOfProp>();
  48. listOfHuman = new List<MessageOfStudent>();
  49. listOfButcher = new List<MessageOfTricker>();
  50. listOfBullet=new List<MessageOfBullet>();
  51. listOfBombedBullet = new List<MessageOfBombedBullet>();
  52. listOfAll=new List<MessageOfAll>();
  53. WindowStartupLocation = WindowStartupLocation.CenterScreen;
  54. comInfo[0] = "183.172.208.156";
  55. comInfo[1] = "8888";
  56. comInfo[2] = "0";
  57. comInfo[3] = "1";
  58. comInfo[4] = "1";
  59. //ConnectToServer(comInfo);
  60. //OnReceive();
  61. DrawMap();
  62. ZoomMap();
  63. MessageOfStudent kurei = new MessageOfStudent();
  64. kurei.X = 10000;
  65. kurei.Y = 20000;
  66. kurei.Speed = 1000;
  67. kurei.PlayerId = 0;
  68. listOfHuman.Add(kurei);
  69. MessageOfAll all= new MessageOfAll();
  70. all.HiddenGateRefreshed = false;
  71. listOfAll.Add(all);
  72. // ReactToCommandline();
  73. }
  74. private void SetStatusBar()
  75. {
  76. StatusBarsOfSurvivor = new StatusBarOfSurvivor[4];
  77. StatusBarsOfHunter = new StatusBarOfHunter(MainGrid, 3, 0);
  78. StatusBarsOfCircumstance = new StatusBarOfCircumstance(MainGrid, 1, 0);
  79. for (int i = 4; i < 8; i++)
  80. {
  81. StatusBarsOfSurvivor[i - 4] = new(MainGrid, i / 2 + 2, i % 2);
  82. }
  83. }
  84. // 连接Server,comInfo[]的格式:0-ip 1- port 2-playerID 3-playerType 4-human/TrickerType
  85. private void ConnectToServer(string[] comInfo)
  86. {
  87. if (!isPlaybackMode)
  88. {
  89. if (comInfo.Length != 5)
  90. throw new Exception("注册信息有误!");
  91. playerID = Convert.ToInt64(comInfo[2]);
  92. Connect.Background = Brushes.Gray;
  93. string connect = new string(comInfo[0]);
  94. connect += ':';
  95. connect += comInfo[1];
  96. Channel channel = new Channel(connect, ChannelCredentials.Insecure);
  97. client = new AvailableService.AvailableServiceClient(channel);
  98. // 没判断连没连上
  99. PlayerMsg playerMsg = new PlayerMsg();
  100. playerMsg.PlayerId = playerID;
  101. playerType = Convert.ToInt64(comInfo[3]) switch
  102. {
  103. 0 => PlayerType.NullPlayerType,
  104. 1 => PlayerType.StudentPlayer,
  105. 2 => PlayerType.TrickerPlayer,
  106. };
  107. if (Convert.ToInt64(comInfo[3]) == 1)
  108. {
  109. humanOrButcher = true;
  110. }
  111. else if (Convert.ToInt64(comInfo[3]) == 2)
  112. {
  113. humanOrButcher = false;
  114. }
  115. playerMsg.PlayerType = playerType;
  116. if (playerType == PlayerType.StudentPlayer)
  117. {
  118. switch (Convert.ToInt64(comInfo[4]))
  119. {
  120. case 0:
  121. playerMsg.StudentType = StudentType.NullStudentType;
  122. break;
  123. case 1:
  124. playerMsg.StudentType = StudentType._1;
  125. break;
  126. case 2:
  127. playerMsg.StudentType = StudentType._2;
  128. break;
  129. case 3:
  130. playerMsg.StudentType = StudentType._3;
  131. break;
  132. case 4:
  133. playerMsg.StudentType = StudentType._4;
  134. break;
  135. default:
  136. break;
  137. }
  138. }
  139. else if (playerType == PlayerType.TrickerPlayer)
  140. {
  141. switch (Convert.ToInt64(comInfo[4]))
  142. {
  143. case 0:
  144. playerMsg.TrickerType = TrickerType.NullTrickerType;
  145. break;
  146. case 1:
  147. playerMsg.TrickerType = TrickerType._1;
  148. break;
  149. case 2:
  150. playerMsg.TrickerType = TrickerType._2;
  151. break;
  152. case 3:
  153. playerMsg.TrickerType = TrickerType._3;
  154. break;
  155. case 4:
  156. playerMsg.TrickerType = TrickerType._4;
  157. break;
  158. default:
  159. break;
  160. }
  161. }
  162. responseStream = client.AddPlayer(playerMsg);
  163. Connect.Background = Brushes.Transparent;
  164. isClientStocked = false;
  165. PorC.Content = "⏸";
  166. // 建立连接的同时加入人物
  167. }
  168. }
  169. // 绘制道具
  170. private void DrawProp(MessageOfProp data, string text)
  171. {
  172. TextBox icon = new()
  173. {
  174. FontSize = 10,
  175. Width = 20,
  176. Height = 20,
  177. Text = text,
  178. HorizontalAlignment = HorizontalAlignment.Left,
  179. VerticalAlignment = VerticalAlignment.Top,
  180. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  181. Background = Brushes.Transparent,
  182. BorderBrush = Brushes.Transparent,
  183. IsReadOnly = true
  184. };
  185. UpperLayerOfMap.Children.Add(icon);
  186. }
  187. // 获得地图信息,未更新数值
  188. private void GetMap(MessageOfMap obj)
  189. {
  190. int[,] map = new int[50, 50];
  191. try
  192. {
  193. for (int i = 0; i < 50; i++)
  194. {
  195. for (int j = 0; j < 50; j++)
  196. {
  197. map[i, j] = Convert.ToInt32(obj.Row[i].Col[j]);
  198. }
  199. }
  200. }
  201. catch
  202. {
  203. mapFlag = false;
  204. }
  205. finally
  206. {
  207. defaultMap = map;
  208. mapFlag = true;
  209. }
  210. }
  211. private void ZoomMap()
  212. {
  213. for (int i = 0; i < 50; i++)
  214. {
  215. for (int j = 0; j < 50; j++)
  216. {
  217. if (mapPatches[i, j] != null)
  218. {
  219. mapPatches[i, j].Width = UpperLayerOfMap.ActualWidth / 50;
  220. mapPatches[i, j].Height = UpperLayerOfMap.ActualHeight / 50;
  221. mapPatches[i, j].HorizontalAlignment = HorizontalAlignment.Left;
  222. mapPatches[i, j].VerticalAlignment = VerticalAlignment.Top;
  223. mapPatches[i, j].Margin = new Thickness(UpperLayerOfMap.ActualWidth / 50 * j, UpperLayerOfMap.ActualHeight / 50 * i, 0, 0);
  224. }
  225. }
  226. }
  227. }
  228. private void DrawMap()
  229. {
  230. for (int i = 0; i < defaultMap.GetLength(0); i++)
  231. {
  232. for (int j = 0; j < defaultMap.GetLength(1); j++)
  233. {
  234. mapPatches[i, j] = new()
  235. {
  236. Width = unitWidth,
  237. Height = unitHeight,
  238. HorizontalAlignment = HorizontalAlignment.Left,
  239. VerticalAlignment = VerticalAlignment.Top,
  240. Margin = new Thickness(Width * (j), Height * (i), 0, 0)
  241. };
  242. // mapPatches[i, j].SetValue(Canvas.LeftProperty, (double)(Width / 65.5 * j));
  243. // mapPatches[i, j].SetValue(Canvas.TopProperty, (double)(Height / 56.5 * i)); // 用zoommap进行修改
  244. switch (defaultMap[i, j])
  245. {
  246. case 6:
  247. mapPatches[i, j].Fill = Brushes.Brown;
  248. mapPatches[i, j].Stroke = Brushes.Brown;
  249. break;
  250. case 7:
  251. mapPatches[i, j].Fill = Brushes.Green;
  252. mapPatches[i, j].Stroke = Brushes.Green;
  253. break;
  254. case 8:
  255. mapPatches[i, j].Fill = Brushes.LightPink;
  256. mapPatches[i, j].Stroke = Brushes.LightPink;
  257. break;//machine
  258. case 9:
  259. mapPatches[i, j].Fill = Brushes.LightSkyBlue;
  260. mapPatches[i, j].Stroke = Brushes.LightSkyBlue;
  261. break;//door
  262. case 10:
  263. foreach (var obj in listOfAll)
  264. {
  265. if(obj.HiddenGateRefreshed)
  266. {
  267. mapPatches[i, j].Fill = Brushes.LightSalmon;
  268. mapPatches[i, j].Stroke = Brushes.LightSalmon;
  269. }
  270. }
  271. break;//emergency
  272. default:
  273. break;
  274. }
  275. UnderLayerOfMap.Children.Add(mapPatches[i, j]);
  276. }
  277. }
  278. hasDrawed = true;
  279. }
  280. //三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
  281. private void DrawLaser(Point source, double theta, double range, double Width) // 三个参数分别为攻击者的位置,攻击方位角(窗口坐标)和攻击半径
  282. {
  283. Point[] endPoint = new Point[4];
  284. Point target = new();
  285. target.X = source.X + range * Math.Cos(theta);
  286. target.Y = source.Y + range * Math.Sin(theta);
  287. endPoint[0].X = source.X + Width * Math.Cos(theta - Math.PI / 2);
  288. endPoint[0].Y = source.Y + Width * Math.Sin(theta - Math.PI / 2);
  289. endPoint[1].X = target.X + Width * Math.Cos(theta - Math.PI / 2);
  290. endPoint[1].Y = target.Y + Width * Math.Sin(theta - Math.PI / 2);
  291. endPoint[2].X = target.X + Width * Math.Cos(theta + Math.PI / 2);
  292. endPoint[2].Y = target.Y + Width * Math.Sin(theta + Math.PI / 2);
  293. endPoint[3].X = source.X + Width * Math.Cos(theta + Math.PI / 2);
  294. endPoint[3].Y = source.Y + Width * Math.Sin(theta + Math.PI / 2);
  295. Polygon laserIcon = new();
  296. laserIcon.Stroke = System.Windows.Media.Brushes.Red;
  297. laserIcon.Fill = System.Windows.Media.Brushes.Red;
  298. laserIcon.StrokeThickness = 2;
  299. laserIcon.HorizontalAlignment = HorizontalAlignment.Left;
  300. laserIcon.VerticalAlignment = VerticalAlignment.Top;
  301. PointCollection laserEndPoints = new();
  302. for (int i = 0; i < 4; i++)
  303. {
  304. laserEndPoints.Add(endPoint[i]);
  305. }
  306. laserIcon.Points = laserEndPoints;
  307. UpperLayerOfMap.Children.Add(laserIcon);
  308. }
  309. private async void OnReceive() // 已按照3.5版proto更新信息,但是左侧信息栏还未填充。log未更新,switch1,2,3更新log
  310. {
  311. try
  312. {
  313. while (responseStream != null && await responseStream.ResponseStream.MoveNext())
  314. {
  315. lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行,否则画图时foreach会有bug
  316. {
  317. listOfHuman.Clear();
  318. listOfButcher.Clear();
  319. listOfProp.Clear();
  320. listOfBombedBullet.Clear();
  321. listOfBullet.Clear();
  322. listOfAll.Clear();
  323. MessageToClient content = responseStream.ResponseStream.Current;
  324. switch (content.GameState)
  325. {
  326. case GameState.GameStart:
  327. case GameState.GameRunning:
  328. foreach (var obj in content.ObjMessage)
  329. {
  330. switch (obj.MessageOfObjCase)
  331. {
  332. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  333. if (humanOrButcher && obj.StudentMessage.PlayerId == playerID)
  334. {
  335. human = obj.StudentMessage;
  336. }
  337. listOfHuman.Add(obj.StudentMessage);
  338. break;
  339. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  340. if (!humanOrButcher && obj.TrickerMessage.PlayerId == playerID)
  341. {
  342. butcher = obj.TrickerMessage;
  343. }
  344. listOfButcher.Add(obj.TrickerMessage);
  345. break;
  346. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  347. listOfProp.Add(obj.PropMessage);
  348. break;
  349. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  350. listOfBombedBullet.Add(obj.BombedBulletMessage);
  351. break;
  352. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  353. listOfBullet.Add(obj.BulletMessage);
  354. break;
  355. }
  356. }
  357. GetMap(content.MapMessage);
  358. listOfAll.Add(content.AllMessage);
  359. break;
  360. case GameState.GameEnd:
  361. foreach (var obj in content.ObjMessage)
  362. {
  363. switch (obj.MessageOfObjCase)
  364. {
  365. case MessageOfObj.MessageOfObjOneofCase.StudentMessage:
  366. listOfHuman.Add(obj.StudentMessage);
  367. break;
  368. case MessageOfObj.MessageOfObjOneofCase.TrickerMessage:
  369. listOfButcher.Add(obj.TrickerMessage);
  370. break;
  371. case MessageOfObj.MessageOfObjOneofCase.PropMessage:
  372. listOfProp.Add(obj.PropMessage);
  373. break;
  374. case MessageOfObj.MessageOfObjOneofCase.BombedBulletMessage:
  375. listOfBombedBullet.Add(obj.BombedBulletMessage);
  376. break;
  377. case MessageOfObj.MessageOfObjOneofCase.BulletMessage:
  378. listOfBullet.Add(obj.BulletMessage);
  379. break;
  380. }
  381. }
  382. listOfAll.Add(content.AllMessage);
  383. break;
  384. }
  385. }
  386. if (responseStream == null)
  387. {
  388. throw new Exception("Unconnected");
  389. }
  390. }
  391. }
  392. catch (Exception ex)
  393. {
  394. ErrorDisplayer error = new("Error: " + ex.ToString());
  395. error.Show();
  396. }
  397. }
  398. //待修改
  399. private bool CanSee(MessageOfStudent msg)
  400. {
  401. if (msg.State == StudentState.Quit)
  402. return false;
  403. //if (playerID >= 2022 || teamID >= 2022)
  404. // return true;
  405. if (humanOrButcher && human != null)
  406. {
  407. if (human.Guid == msg.Guid) // 自己能看见自己
  408. return true;
  409. }
  410. if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
  411. return false;
  412. if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Classroom)
  413. return true;
  414. if (humanOrButcher && human != null)
  415. {
  416. if (msg.Place != human.Place)
  417. return false;
  418. }
  419. else if (!humanOrButcher && butcher != null)
  420. {
  421. if (msg.Place != butcher.Place)
  422. return false;
  423. }
  424. return true;
  425. }
  426. private bool CanSee(MessageOfTricker msg)
  427. {
  428. // if (playerID >= 2022 || teamID >= 2022)
  429. // return true;
  430. if (!humanOrButcher && butcher != null)
  431. {
  432. if (butcher.Guid == msg.Guid) // 自己能看见自己
  433. return true;
  434. }
  435. if (msg.Place == PlaceType.Grass || msg.Place == PlaceType.Gate || msg.Place == PlaceType.HiddenGate)
  436. return false;
  437. if (msg.Place == PlaceType.Land || msg.Place == PlaceType.Classroom)
  438. return true;
  439. if (humanOrButcher && human != null)
  440. {
  441. if (msg.Place != human.Place)
  442. return false;
  443. }
  444. else if (!humanOrButcher && butcher != null)
  445. {
  446. if (msg.Place != butcher.Place)
  447. return false;
  448. }
  449. return true;
  450. }
  451. private bool CanSee(MessageOfProp msg)
  452. {
  453. if (msg.Place == PlaceType.Land)
  454. return true;
  455. if (humanOrButcher && human != null)
  456. {
  457. if (msg.Place != human.Place)
  458. return false;
  459. }
  460. else if (!humanOrButcher && butcher != null)
  461. {
  462. if (msg.Place != butcher.Place)
  463. return false;
  464. }
  465. return true;
  466. }
  467. private bool CanSee(MessageOfBullet msg)
  468. {
  469. if (msg.Place == PlaceType.Land)
  470. return true;
  471. if (humanOrButcher && human != null)
  472. {
  473. if (msg.Place != human.Place)
  474. return false;
  475. }
  476. else if (!humanOrButcher && butcher != null)
  477. {
  478. if (msg.Place != butcher.Place)
  479. return false;
  480. }
  481. return true;
  482. }
  483. private void Refresh(object? sender, EventArgs e) // 已按照3.5版proto更新信息,circumstance栏未更新 log未更新
  484. {
  485. // Bonus();
  486. if (WindowState == WindowState.Maximized)
  487. MaxButton.Content = "❐";
  488. else
  489. MaxButton.Content = "🗖";
  490. if (StatusBarsOfSurvivor != null)
  491. for (int i = 4; i < 8; i++)
  492. {
  493. StatusBarsOfSurvivor[i - 4].SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  494. }
  495. if (StatusBarsOfHunter != null)
  496. StatusBarsOfHunter.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  497. if (StatusBarsOfCircumstance != null)
  498. StatusBarsOfCircumstance.SetFontSize(12 * UpperLayerOfMap.ActualHeight / 650);
  499. // 完成窗口信息更新
  500. if (!isClientStocked)
  501. {
  502. unit = Math.Sqrt(UpperLayerOfMap.ActualHeight * UpperLayerOfMap.ActualWidth) / 50;
  503. unitHeight = UpperLayerOfMap.ActualHeight / 50;
  504. unitWidth = UpperLayerOfMap.ActualWidth / 50;
  505. try
  506. {
  507. // if (log != null)
  508. //{
  509. // string temp = "";
  510. // for (int i = 0; i < dataDict[GameObjType.Character].Count; i++)
  511. // {
  512. // temp += Convert.ToString(dataDict[GameObjType.Character][i].MessageOfCharacter.TeamID) + "\n";
  513. // }
  514. // log.Content = temp;
  515. // }
  516. UpperLayerOfMap.Children.Clear();
  517. // if ((communicator == null || !communicator.Client.IsConnected) && !isPlaybackMode)
  518. //{
  519. // UnderLayerOfMap.Children.Clear();
  520. // throw new Exception("Client is unconnected.");
  521. // }
  522. // else
  523. //{
  524. lock (drawPicLock) // 加锁是必要的,画图操作和接收信息操作不能同时进行
  525. {
  526. foreach (var data in listOfAll)
  527. {
  528. StatusBarsOfCircumstance.SetValue(data);
  529. }
  530. if (!hasDrawed && mapFlag)
  531. DrawMap();
  532. foreach (var data in listOfHuman)
  533. {
  534. StatusBarsOfSurvivor[data.PlayerId].SetValue(data);
  535. if (CanSee(data))
  536. {
  537. Ellipse icon = new()
  538. {
  539. Width = unitWidth,
  540. Height = unitHeight,
  541. HorizontalAlignment = HorizontalAlignment.Left,
  542. VerticalAlignment = VerticalAlignment.Top,
  543. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  544. Fill = Brushes.BlueViolet,
  545. };
  546. UpperLayerOfMap.Children.Add(icon);
  547. }
  548. }
  549. foreach (var data in listOfButcher)
  550. {
  551. StatusBarsOfHunter.SetValue(data);
  552. if (CanSee(data))
  553. {
  554. Ellipse icon = new()
  555. {
  556. Width = unitWidth,
  557. Height = unitHeight,
  558. HorizontalAlignment = HorizontalAlignment.Left,
  559. VerticalAlignment = VerticalAlignment.Top,
  560. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  561. Fill = Brushes.Black,
  562. };
  563. UpperLayerOfMap.Children.Add(icon);
  564. }
  565. }
  566. foreach (var data in listOfProp)
  567. {
  568. if (CanSee(data))
  569. {
  570. switch (data.Type)
  571. {
  572. case PropType.Ptype1:
  573. DrawProp(data, "🔧");
  574. break;
  575. case PropType.Ptype2:
  576. DrawProp(data, "🛡");
  577. break;
  578. case PropType.Ptype3:
  579. DrawProp(data, "♥");
  580. break;
  581. case PropType.Ptype4:
  582. DrawProp(data, "⛸");
  583. break;
  584. default:
  585. DrawProp(data, "");
  586. break;
  587. }
  588. }
  589. }
  590. foreach (var data in listOfBullet)
  591. {
  592. if (CanSee(data))
  593. {
  594. Ellipse icon = new()
  595. {
  596. Width = 10,
  597. Height = 10,
  598. HorizontalAlignment = HorizontalAlignment.Left,
  599. VerticalAlignment = VerticalAlignment.Top,
  600. Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
  601. Fill = Brushes.Red
  602. };
  603. UpperLayerOfMap.Children.Add(icon);
  604. }
  605. }
  606. foreach (var data in listOfBombedBullet)
  607. {
  608. switch (data.Type)
  609. {
  610. case BulletType.FastBullet:
  611. {
  612. Ellipse icon = new();
  613. double bombRange = data.BombRange / 1000;
  614. icon.Width = bombRange * unitWidth;
  615. icon.Height = bombRange * unitHeight;
  616. icon.HorizontalAlignment = HorizontalAlignment.Left;
  617. icon.VerticalAlignment = VerticalAlignment.Top;
  618. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  619. icon.Fill = Brushes.Red;
  620. UpperLayerOfMap.Children.Add(icon);
  621. break;
  622. }
  623. case BulletType.AtomBomb:
  624. {
  625. Ellipse icon = new Ellipse();
  626. double bombRange = data.BombRange / 1000;
  627. icon.Width = bombRange * unitWidth;
  628. icon.Height = bombRange * unitHeight;
  629. icon.HorizontalAlignment = HorizontalAlignment.Left;
  630. icon.VerticalAlignment = VerticalAlignment.Top;
  631. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  632. icon.Fill = Brushes.Red;
  633. UpperLayerOfMap.Children.Add(icon);
  634. break;
  635. }
  636. case BulletType.OrdinaryBullet:
  637. {
  638. Ellipse icon = new Ellipse();
  639. double bombRange = data.BombRange / 1000;
  640. icon.Width = bombRange * unitWidth;
  641. icon.Height = bombRange * unitHeight;
  642. icon.HorizontalAlignment = HorizontalAlignment.Left;
  643. icon.VerticalAlignment = VerticalAlignment.Top;
  644. icon.Margin = new Thickness(data.Y * unitWidth / 1000.0 - bombRange * unitWidth / 2, data.X * unitHeight / 1000.0 - bombRange * unitHeight / 2, 0, 0);
  645. icon.Fill = Brushes.Red;
  646. UpperLayerOfMap.Children.Add(icon);
  647. break;
  648. }
  649. case BulletType.LineBullet:
  650. {
  651. double bombRange = data.BombRange / 1000;
  652. DrawLaser(new Point(data.Y * unitWidth / 1000.0, data.X * unitHeight / 1000.0), -data.FacingDirection + Math.PI / 2, bombRange * unitHeight, 0.5 * unitWidth);
  653. break;
  654. }
  655. default:
  656. break;
  657. }
  658. }
  659. //}
  660. ZoomMap();
  661. }
  662. }
  663. catch (Exception exc)
  664. {
  665. ErrorDisplayer error = new("Error: " + exc.ToString());
  666. error.Show();
  667. isClientStocked = true;
  668. PorC.Content = "▶";
  669. }
  670. }
  671. counter++;
  672. }
  673. // 键盘控制,未完善
  674. private void KeyBoardControl(object sender, KeyEventArgs e)
  675. {
  676. if (!isPlaybackMode)
  677. {
  678. switch (e.Key)
  679. {
  680. case Key.W:
  681. case Key.NumPad8:
  682. MoveMsg msgW = new()
  683. {
  684. PlayerId = playerID,
  685. TimeInMilliseconds = 50,
  686. Angle = Math.PI
  687. };
  688. client.Move(msgW);
  689. break;
  690. case Key.NumPad2:
  691. case Key.S:
  692. MoveMsg msgS = new()
  693. {
  694. PlayerId = playerID,
  695. TimeInMilliseconds = 50,
  696. Angle = 0
  697. };
  698. client.Move(msgS);
  699. break;
  700. case Key.D:
  701. case Key.NumPad6:
  702. MoveMsg msgD = new()
  703. {
  704. PlayerId = playerID,
  705. TimeInMilliseconds = 50,
  706. Angle = Math.PI / 2
  707. };
  708. client.Move(msgD);
  709. break;
  710. case Key.A:
  711. case Key.NumPad4:
  712. MoveMsg msgA = new()
  713. {
  714. PlayerId = playerID,
  715. TimeInMilliseconds = 50,
  716. Angle = 3 * Math.PI / 2
  717. };
  718. client.Move(msgA);
  719. break;
  720. case Key.J:
  721. AttackMsg msgJ = new()
  722. {
  723. PlayerId = playerID,
  724. Angle = Math.PI
  725. };
  726. client.Attack(msgJ);
  727. break;
  728. case Key.F:
  729. PropMsg msgF = new()
  730. {
  731. PlayerId = playerID,
  732. };
  733. client.PickProp(msgF);
  734. break;
  735. case Key.E:
  736. PropMsg msgE = new()
  737. {
  738. PlayerId = playerID,
  739. };
  740. client.UseProp(msgE);
  741. break;
  742. case Key.Q:
  743. SkillMsg msgQ = new()
  744. {
  745. PlayerId = playerID,
  746. };
  747. client.UseSkill(msgQ);
  748. break;
  749. default:
  750. break;
  751. }
  752. }
  753. }
  754. //鼠标双击
  755. private void Attack(object sender, RoutedEventArgs e)
  756. {
  757. if (!isPlaybackMode)
  758. {
  759. if (humanOrButcher&&human != null)
  760. {
  761. AttackMsg msgJ = new()
  762. {
  763. PlayerId = playerID
  764. };
  765. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  766. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  767. msgJ.Angle = Math.Atan2(mouseY - human.Y, mouseX - human.X);
  768. client.Attack(msgJ);
  769. }
  770. if (!humanOrButcher && butcher != null)
  771. {
  772. AttackMsg msgJ = new()
  773. {
  774. PlayerId = playerID
  775. };
  776. double mouseY = Mouse.GetPosition(UpperLayerOfMap).X * 1000 / unitWidth;
  777. double mouseX = Mouse.GetPosition(UpperLayerOfMap).Y * 1000 / unitHeight;
  778. msgJ.Angle = Math.Atan2(mouseY - butcher.Y, mouseX - butcher.X);
  779. client.Attack(msgJ);
  780. }
  781. }
  782. }
  783. // 之后需要修改,现在只具有修改按钮形状的功能,并不能实现暂停/继续
  784. private void ClickToPauseOrContinue(object sender, RoutedEventArgs e)
  785. {
  786. if (!isClientStocked)
  787. {
  788. isClientStocked = true;
  789. PorC.Content = "▶";
  790. }
  791. else
  792. {
  793. isClientStocked = false;
  794. PorC.Content = "⏸";
  795. }
  796. }
  797. // 未复现
  798. private void ClickToConnect(object sender, RoutedEventArgs e)
  799. {
  800. }
  801. // 窗口最大化、关闭、最小化、拖拽
  802. private void ClickToMaxmize(object sender, RoutedEventArgs e)
  803. {
  804. if (WindowState != WindowState.Maximized)
  805. WindowState = WindowState.Maximized;
  806. else
  807. WindowState = WindowState.Normal;
  808. }
  809. private void ClickToClose(object sender, RoutedEventArgs e)
  810. {
  811. Application.Current.Shutdown();
  812. }
  813. private void ClickToMinimize(object sender, RoutedEventArgs e)
  814. {
  815. WindowState = WindowState.Minimized;
  816. }
  817. private void DragWindow(object sender, RoutedEventArgs e)
  818. {
  819. DragMove();
  820. }
  821. // 寻求帮助、访问EESAST(部分功能未复原)
  822. private void ClickForHelp(object sender, RoutedEventArgs e)
  823. {
  824. PleaseWait();
  825. }
  826. private void ClickToVisitEESAST(object sender, RoutedEventArgs e)
  827. {
  828. try
  829. {
  830. _ = Process.Start("C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe", "https://eesast.com");
  831. }
  832. catch (Exception exc)
  833. {
  834. // ErrorDisplayer error = new("发生错误。以下是系统报告\n" + exc.ToString());
  835. // error.Show();
  836. }
  837. }
  838. // 配置连接(未复原)、我的AI(THUAI5未实现)、获取更新、天梯信息(可能需要网站协助)
  839. private void ClickToSetConnect(object sender, RoutedEventArgs e)
  840. {
  841. // ConnectRegister crg = new();
  842. // crg.Show();
  843. }
  844. private void ClickToEnterVS(object sender, RoutedEventArgs e)
  845. {
  846. // try
  847. //{
  848. // if (!File.Exists("VSRoute.txt"))
  849. // {
  850. // File.Create("VSRoute.txt");
  851. // Exception ex = new("没有路径存储文件,已为您创建。请将VS路径输入该文件,并重新操作。");
  852. // throw ex;
  853. // }//创建路径文件
  854. // using StreamReader sr = new("VSRoute.txt");
  855. // _ = Process.Start(sr.ReadLine());
  856. // }
  857. // catch (Exception exc)
  858. //{
  859. // ErrorDisplayer error = new("发生错误。以下是系统报告:\n" + exc.ToString());
  860. // error.Show();
  861. // }
  862. PleaseWait();
  863. }
  864. private void ClickForUpdate(object sender, RoutedEventArgs e)
  865. {
  866. PleaseWait();
  867. }
  868. private void ClickToCheckLadder(object sender, RoutedEventArgs e)
  869. {
  870. PleaseWait();
  871. }
  872. // 敬请期待函数
  873. private void PleaseWait()
  874. {
  875. try
  876. {
  877. throw new Exception("敬请期待");
  878. }
  879. catch (Exception exc)
  880. {
  881. // ErrorDisplayer error = new(exc.Message);
  882. // error.Show();
  883. }
  884. }
  885. // 以下为Mainwindow自定义属性
  886. private readonly DispatcherTimer timer; // 定时器
  887. private long counter; // 预留的取时间变量
  888. AvailableService.AvailableServiceClient client;
  889. AsyncServerStreamingCall<MessageToClient>? responseStream;
  890. private StatusBarOfSurvivor[] StatusBarsOfSurvivor;
  891. private StatusBarOfHunter StatusBarsOfHunter;
  892. private StatusBarOfCircumstance StatusBarsOfCircumstance;
  893. private bool isClientStocked;
  894. private bool isPlaybackMode;
  895. private long playerID;
  896. private PlayerType playerType;
  897. private double unit;
  898. private double unitHeight;
  899. private double unitWidth;
  900. private readonly Rectangle[,] mapPatches = new Rectangle[50, 50];
  901. private List<MessageOfProp> listOfProp;
  902. private List<MessageOfStudent> listOfHuman;
  903. private List<MessageOfTricker> listOfButcher;
  904. private List<MessageOfBullet> listOfBullet;
  905. private List<MessageOfBombedBullet> listOfBombedBullet;
  906. private List<MessageOfAll> listOfAll;
  907. private object drawPicLock = new object();
  908. private MessageOfStudent? human = null;
  909. private MessageOfTricker? butcher = null;
  910. private bool humanOrButcher;//true for human
  911. private bool bonusflag;
  912. private bool mapFlag = false;
  913. private bool hasDrawed = false;
  914. public int[,] defaultMap = new int[,] {{ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 },
  915. { 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
  916. { 6, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 6 },
  917. { 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
  918. { 6, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 6 },
  919. { 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,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