本文整理汇总了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);
}
示例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");
}
示例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");
}
示例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");
}