本文整理汇总了C#中IController.SendMapUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# IController.SendMapUpdate方法的具体用法?C# IController.SendMapUpdate怎么用?C# IController.SendMapUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IController
的用法示例。
在下文中一共展示了IController.SendMapUpdate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ScenarioControllerLoop
public void ScenarioControllerLoop(IController receiver)
{
_receiver = receiver;
UTM_Mapping.HorizonalMetersPerPixel = 8.49990671075954650f;
UTM_Mapping.VerticalMetersPerPixel = 8.56718696599567760f;
try
{
while (true)
{
if (DDD_Global.Instance.IsConnected)
{
List<SimulationEvent> events = DDD_Global.Instance.GetEvents();
foreach (SimulationEvent vpEvent in events)
{
switch (vpEvent.eventType)
{
case "SimulationTimeEvent":
try
{
receiver.TimeTick(((StringValue)vpEvent.parameters["SimulationTime"]).value);
receiver.SendMapUpdate(false);
}
catch (Exception e)
{
Console.WriteLine(e.StackTrace);
throw new ControllerException(Fmt_ErrorMsg("SimulationTimeEvent", e.Message));
}
break;
case "ScoreUpdate":
try
{
if (((StringValue)vpEvent.parameters["DecisionMakerID"]).value == DDD_Global.Instance.PlayerID)
{
string score_name = ((StringValue)vpEvent.parameters["ScoreName"]).value;
double score_value = ((DoubleValue)vpEvent.parameters["ScoreValue"]).value;
receiver.ScoreUpdate(score_name, score_value);
}
}
catch (Exception e)
{
throw new ControllerException(Fmt_ErrorMsg("ScoreUpdate", e.Message));
}
break;
case "GameSpeed":
try
{
DDD_Global.Instance.GameSpeed = ((DoubleValue)vpEvent.parameters["SpeedFactor"]).value;
}
catch (Exception e)
{
throw new ControllerException(Fmt_ErrorMsg("GameSpeed", e.Message));
}
break;
case "CreateChatRoom":
try
{
string room_name = ((StringValue)vpEvent.parameters["RoomName"]).value;
List<string> membership_list = ((StringListValue)vpEvent.parameters["MembershipList"]).strings;
if (membership_list != null)
{
if (membership_list.Contains(DDD_Global.Instance.PlayerID))
{
if (room_name != null)
{
if (room_name.Length > 0)
{
receiver.CreateChatRoom("chat - " + room_name, room_name, membership_list);
}
}
}
}
}
catch (Exception e)
{
throw new ControllerException(Fmt_ErrorMsg("CreateChatRoom", e.Message));
}
break;
//.........这里部分代码省略.........