当前位置: 首页>>代码示例>>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;未经允许,请勿转载。