RobotCase_FirstCase.cs 1.1 KB

123456789101112131415161718192021222324252627
  1. using System;
  2. namespace ET.Server
  3. {
  4. [Invoke(RobotCaseType.FirstCase)]
  5. public class RobotCase_FirstCase: ARobotCase
  6. {
  7. protected override async ETTask Run(RobotCase robotCase)
  8. {
  9. await ETTask.CompletedTask;
  10. //using ListComponent<Scene> robots = ListComponent<Scene>.Create();
  11. //// 创建了两个机器人,生命周期是RobotCase,RobotCase_FirstCase.Run执行结束,机器人就会删除
  12. //await robotCase.NewRobot(2, robots);
  13. //foreach (Scene robotScene in robots)
  14. //{
  15. // M2C_TestRobotCase response = await robotScene.GetComponent<Client.SessionComponent>().Session.Call(new C2M_TestRobotCase() {N = robotScene.Zone}) as M2C_TestRobotCase;
  16. // if (response.N != robotScene.Zone)
  17. // {
  18. // // 跟预期不一致就抛异常,外层会catch住在控制台上打印
  19. // throw new Exception($"robot case: {RobotCaseType.FirstCase} run fail!");
  20. // }
  21. //}
  22. }
  23. }
  24. }