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