예제 #1
0
        public void SuccessTest()
        {
            Container container = new Container();

            container.InitComponentComparers();

            container.MmConfig = MatchmakingTest.TestConfig;

            int roomCount = 4;

            for (int i = 0; i < roomCount * 2 * container.MmConfig.PlayerPerTeam; ++i)
            {
                int entityId = container.CreateEntity();
                container.AddMmrComponent(entityId, i * (container.MmConfig.MaxDifferenceAllowed - 1));
                container.AddPlayerInfoComponent(entityId, i);
                container.AddWaitingComponent(entityId, 0);
            }

            CreateRoomSystem system = new CreateRoomSystem();

            system.Execute(container);

            StringBuilder builder = new StringBuilder();

            Assert.AreEqual(roomCount, container.RoomInfoComponentsCount);
            for (int i = 0; i < container.RoomInfoComponentsCount; ++i)
            {
                if (container.TryGetRoomInfoTeamAFromIndex(i, out int[] teamA) &&
예제 #2
0
    void Start()
    {
        _container = new Container();
        _container.InitComponentComparers();
        _container.InitMatchmakingCofig();
        _container.InitPlayerDataBase();

        _createJoinRequestSystem = new CreateJoinRequestSystem(_container.PlayerDatabaseSize);
        _turnSystem       = new TurnSystem();
        _createRoomSystem = new CreateRoomSystem();

        _createJoinRequestSystem.Execute(_container);
        _roomStartIndex = 0;
    }