當前位置: 首頁>>代碼示例>>C#>>正文


C# NetworkClient.Subscribe方法代碼示例

本文整理匯總了C#中NetworkClient.Subscribe方法的典型用法代碼示例。如果您正苦於以下問題:C# NetworkClient.Subscribe方法的具體用法?C# NetworkClient.Subscribe怎麽用?C# NetworkClient.Subscribe使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NetworkClient的用法示例。


在下文中一共展示了NetworkClient.Subscribe方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: InitializeScene

        public override void InitializeScene(ICanvas canvas)
        {
            // Connect with simulator
            connection = new NetworkClient();
            if (!connection.Connect("ganberg2", 9999))
            {
                throw new ApplicationException("Unable to establish connection with host.");
            }
            else
            {
                connection.Subscribe("TimeTick");
                connection.Subscribe("ViewProUpdate");
            }

            // Create and initialize Gameboard.
            background = new Obj_Sprite(texture_file, SpriteFlags.SortTexture | SpriteFlags.AlphaBlend);
            background.Initialize(canvas);
            background.Position = new Vector3(0, 0, 0);
            background.Rotation = new Vector3(0, 0, 0);
            background.Scaling = new Vector3(1, 1, 1);
            background.Texture(canvas);

            // Initialize and create Font;
            this._myFont = canvas.CreateFont(new System.Drawing.Font("Arial", 10));
            message = string.Empty;

            //f16 = new Obj_Sprite("f16.png", SpriteFlags.AlphaBlend);
            //f16.Initialize(canvas);
            //f16.Texture(canvas);
            //f16.Position = new Vector3(0, 0, 0);
            //f16.Rotation = new Vector3(0, 0, 0);
            //f16.Scaling = new Vector3(1, 1, 1);

        }
開發者ID:wshanshan,項目名稱:DDD,代碼行數:34,代碼來源:GIS_Scene.cs

示例2: AddNetworkClient

        public void AddNetworkClient(NetworkClient s)
        {
            server = s;

            simModelInfo = smr.readModel("SimulationModel.xml");

            SimulationEventDistributor dist = new SimulationEventDistributor(ref simModelInfo);
            SimulationEventDistributorClient cc = new SimulationEventDistributorClient();

            dist.RegisterClient(ref cc);
            server.Subscribe("MoveDone");
            server.Subscribe("MoveObjectRequest");
            server.Subscribe("AttackObjectRequest");
        }
開發者ID:wshanshan,項目名稱:DDD,代碼行數:14,代碼來源:EventCommunicator.cs

示例3: EventCommunicator

        public EventCommunicator(NetworkClient s)
        {
            server = s;
            //Dennis: This needs to be updated to your directory
            simModelInfo = smr.readModel(@"C:\SVN\NewDDD\src\DataFiles\SimulationModel.xml");
//simModelInfo = smr.readModel("SimulationModel.xml");
            SimulationEventDistributor dist = new SimulationEventDistributor(ref simModelInfo);
            SimulationEventDistributorClient cc = new SimulationEventDistributorClient();

            dist.RegisterClient(ref cc);
            server.Subscribe("MoveDone");
        }
開發者ID:wshanshan,項目名稱:DDD,代碼行數:12,代碼來源:EventCommunicator.cs

示例4: EventListener

        protected EventListener(NetworkClient server)
        {
            myQM = QueueManager.UniqueInstance();

            SimulationModelReader smr = new SimulationModelReader();
            SimulationModelInfo simModelInfo = smr.readModel("SimulationModel.xml");

            SimulationEventDistributor dist = new SimulationEventDistributor(ref simModelInfo);
            SimulationEventDistributorClient cc = new SimulationEventDistributorClient();

            dist.RegisterClient(ref cc);
            server.Subscribe("MoveDone");

        }
開發者ID:wshanshan,項目名稱:DDD,代碼行數:14,代碼來源:EventListener.cs


注:本文中的NetworkClient.Subscribe方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。