Example #1
0
        private void Start()
        {
            BattleRoyaleClientMatchModel matchModel = matchModelStorage.GetMatchModel();
            UdpSendUtils udpSendUtils = udpManager.CreateConnection(matchModel);

            PingStatisticsStorage pingStatisticsStorage = new PingStatisticsStorage(udpSendUtils);

            clientMatchSimulation = new ClientMatchSimulation(battleUiController, udpSendUtils, matchModel, pingStatisticsStorage);

            var playersStorage      = clientMatchSimulation.GetPlayersStorage();
            var transformStorage    = clientMatchSimulation.GetTransformStorage();
            var healthPointsStorage = clientMatchSimulation.GetHealthPointsStorage();
            var maxHealthPointsMessagePackStorage  = clientMatchSimulation.GetMaxHealthPointsMessagePackStorage();
            IKillMessageStorage killMessageStorage = clientMatchSimulation.GetKillMessageStorage();

            var messageWrapperHandler = new MessageWrapperHandler(udpSendUtils,
                                                                  matchModel.MatchId,
                                                                  transformStorage,
                                                                  playersStorage,
                                                                  healthPointsStorage,
                                                                  maxHealthPointsMessagePackStorage,
                                                                  pingStatisticsStorage,
                                                                  killMessageStorage);

            IByteArrayHandler byteArrayHandler = new ByteArrayHandler(messageWrapperHandler);


            udpManager.StartListening(byteArrayHandler);
        }