123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- using System;
- using System.Collections.Generic;
- namespace ET.Server
- {
- public static class RobotCaseSystem
- {
-
- public static async ETTask NewRobot(this RobotCase self, int count, List<Scene> scenes)
- {
- ETTask[] tasks = new ETTask[count];
- for (int i = 0; i < count; ++i)
- {
- tasks[i] = self.NewRobot(scenes);
- }
- await ETTaskHelper.WaitAll(tasks);
- }
- private static async ETTask NewRobot(this RobotCase self, List<Scene> scenes)
- {
- try
- {
- scenes.Add(await self.NewRobot());
- }
- catch (Exception e)
- {
- Log.Error(e);
- }
- }
-
- public static async ETTask NewZoneRobot(this RobotCase self, int zone, int count, List<Scene> scenes)
- {
- ETTask[] tasks = new ETTask[count];
- for (int i = 0; i < count; ++i)
- {
- tasks[i] = self.NewZoneRobot(zone + i, scenes);
- }
- await ETTaskHelper.WaitAll(tasks);
- }
-
- private static async ETTask NewZoneRobot(this RobotCase self, int zone, List<Scene> scenes)
- {
- try
- {
- scenes.Add(await self.NewRobot(zone));
- }
- catch (Exception e)
- {
- Log.Error(e);
- }
- }
- public static async ETTask<Scene> NewRobot(this RobotCase self, int zone)
- {
- return await self.NewRobot(zone, $"Robot_{zone}");
- }
- public static async ETTask<Scene> NewRobot(this RobotCase self, int zone, string name)
- {
- await ETTask.CompletedTask;
- return null;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- private static async ETTask<Scene> NewRobot(this RobotCase self)
- {
- await ETTask.CompletedTask;
- return null;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- }
- }
|