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