Esempio n. 1
0
 IWorld CreateWorld(params string[] args)
 {
     var loader = new Loader();
     loader.AddLevel("Demo", "Level1", () => new DemoCompetitions.Level1());
     loader.AddLevel("RoboMovies", "Level1", () => new RMCompetitions.Level1());
     return loader.Load(args);
 }
Esempio n. 2
0
        public static Loader GetLoader()
        {
            var loader = new Loader();

            loader.AddLevel("RoboMovies", "Level1", () => new RoboMovies.KroR.Level1());
            loader.AddLevel("RoboMovies", "Level2", () => new RoboMovies.KroR.Level2());
            loader.AddLevel("RoboMovies", "Level3", () => new RoboMovies.KroR.Level3());
            loader.AddLevel("Demo", "Demo", () => new Demo.DemoCompetitions());
            loader.AddLevel("Demo", "DWM", () => new Demo.DWMCompetitions());
            return loader;
        }
Esempio n. 3
0
    IWorld CreateWorld(params string[] args)
    {
        var loader = new Loader();
        loader.AddLevel("Demo", "Level1", () => new DemoCompetitions.Level1());
        loader.AddLevel("RoboMovies", "Level1", () => new RMCompetitions.Level1());
        //loader.AddLevel("RepairTheStarship", "Level1", () => new RepairTheStarship.Level1());

        ////для Насти:
        //loader.Levels.Keys.ToArray(); // список всех соревнований
        //loader.Levels["Demo"].Keys.ToArray(); //список всех уровней соревнования
        //var competitions = loader.Levels["Demo"]["Level1"]();
        //competitions.Logic.Bots.Keys.ToArray(); //список всех доступных ботов
        //competitions.Logic.ControllersId.ToArray(); //список всех контроллеров (Left/Right в наших соревнованиях)
        //// надо создать
        //LoadingData data = null;
        //SettingsProposal proposal = null;
        //// и из этого мы потом сделаем соревнования
        return loader.Load(args);
    }
Esempio n. 4
0
    public static void Start()
    {
        Debugger.DisableByDefault = true;
        Debugger.EnabledTypes.Add(DebuggerMessageType.Unity);
        Debugger.EnabledTypes.Add(DebuggerMessageType.UnityTest);
        //Debugger.EnabledTypes.Add(RMDebugMessage.WorldCreation);
        //Debugger.EnabledTypes.Add(RMDebugMessage.Logic);
        Debugger.EnabledTypes.Add(RMDebugMessage.Workflow);
        Debugger.EnabledTypes.Add(DebuggerMessageType.Workflow);
        Debugger.Logger = Debug.Log;

        Loader = new Loader();
        Loader.AddLevel("Demo", "Test", () => new DemoCompetitions.Level1());
        Loader.AddLevel("RoboMovies", "Test", () => new RMCompetitions.Level1());
        Loader.AddLevel("RoboMovies", "Level1", () => new RMCompetitions.Level1());

        networkServer = new SoloNetworkServer(UnityConstants.SoloNetworkPort);
        Action networkServerAction = () => networkServer.StartThread();
        networkServerAction.BeginInvoke(null, null);

        torunamentServer = new TournamentServer(UnityConstants.TournamentPort);
        Action tournamentServerAction = () => torunamentServer.StartThread();
        tournamentServerAction.BeginInvoke(null, null);
    }
Esempio n. 5
0
    //Этот метод нужно вызвать ровно один раз навсегда! для этого завести флаг.
    public static void Start()
    {
        Debugger.DisableByDefault = true;
        Debugger.EnabledTypes.Add(DebuggerMessageType.Unity);
        Debugger.EnabledTypes.Add(DebuggerMessageType.UnityTest);
        Debugger.EnabledTypes.Add(RMDebugMessage.WorldCreation);
        Debugger.EnabledTypes.Add(RMDebugMessage.Logic);
        Debugger.EnabledTypes.Add(RMDebugMessage.Workflow);
        Debugger.EnabledTypes.Add(DebuggerMessageType.Workflow);
        // Debugger.EnabledTypes.Add(DebuggerMessageType.Initialization);
        Debugger.Logger = s => Debug.Log(s);
        //создание и заполнение loader-а сюда
        loader = new Loader();
        loader.AddLevel("Demo", "Test", () => new DemoCompetitions.Level1());
        loader.AddLevel("RoboMovies", "Test", () => new RMCompetitions.Level1());

        RenewWaitingNetworkServer();
        //создает PercistentServer и подписываемся на его событие
        server = new PercistentTCPServer(14000);
        server.ClientConnected += ClientConnected;
        server.Printer = str => Debugger.Log(DebuggerMessageType.Unity,"FROM SERVER: " + str);
        //new Thread(server.StartThread) { IsBackground = true }.Start();
        RunThread(server.StartThread, "Server");
    }
Esempio n. 6
0
    public static void Start()
    {
        Debugger.DisableByDefault = true;
        Debugger.EnabledTypes.Add(DebuggerMessageType.Unity);
        Debugger.EnabledTypes.Add(DebuggerMessageType.UnityTest);
        Debugger.EnabledTypes.Add(DebuggerMessageType.Error);
        //Debugger.EnabledTypes.Add(RMDebugMessage.WorldCreation);
        //Debugger.EnabledTypes.Add(RMDebugMessage.Logic);
        Debugger.EnabledTypes.Add(RMDebugMessage.Workflow);
        Debugger.Logger = Debug.Log;

        WebInfo.InitWebConfigsFromFile(UnityConstants.PathToConfigFile);

        HttpWorker.SayStatus(true);

        Loader = new Loader();
        Loader.AddLevel("Demo", "Test", () => new DemoCompetitions.Level1());
        Loader.AddLevel("RoboMovies", "Test", () => new RMCompetitions.Level1());
        //Loader.AddLevel("RoboMovies", "Level1", () => new RMCompetitions.Level1());
        Loader.AddLevel("TheBeachBots", "Test", () => new TBBCompetitions.Level1());

        networkServer = new SoloNetworkServer(UnityConstants.SoloNetworkPort);
        Action networkServerAction = () => networkServer.StartThread();
        networkServerAction.BeginInvoke(null, null);

        torunamentServer = new TournamentServer(UnityConstants.TournamentPort);
        Action tournamentServerAction = () => torunamentServer.StartThread();
        tournamentServerAction.BeginInvoke(null, null);

        if (UnityConstants.NeedToOpenServicePort)
        {
            serviceServer = new ServiceServer(UnityConstants.ServicePort);
            Action startServer = () => serviceServer.StartThread();
            startServer.BeginInvoke(null, null);
        }
    }
Esempio n. 7
0
 public static void RunDWM(string testName)
 {
     var loader = new Loader();
     loader.AddLevel("Demo", "DWM", () => new Demo.DWMCompetitions());
     loader.RunSelfTestInVSContext("Demo", "DWM", testName, new NUnitAsserter());
 }