本文整理汇总了C#中Aptima.Asim.DDD.CommonComponents.SimulationEventTools.SimulationEvent类的典型用法代码示例。如果您正苦于以下问题:C# SimulationEvent类的具体用法?C# SimulationEvent怎么用?C# SimulationEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SimulationEvent类属于Aptima.Asim.DDD.CommonComponents.SimulationEventTools命名空间,在下文中一共展示了SimulationEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AttackSucceeded
public void AttackSucceeded(SimulationEvent ev)
{
if (m_currentBehavior != null)
{
m_currentBehavior.AttackSucceeded(ev);
}
}
示例2: ProcessEvent
public void ProcessEvent(SimulationEvent e)
{
//objectProxies = bbClient.GetObjectProxies();
switch (e.eventType)
{
case "NewObject":
NewObject(e);
break;
case "RevealObject":
RevealObject(e);
break;
case "StateChange":
StateChange(e);
break;
case "TimeTick":
TimeTick(e);
break;
case "ExternalApp_SimStop":
ResetSimulation();
break;
case "ForceUpdateObjectAttribute":
ForceUpdateObjectAttribute(e);
break;
default:
break;
}
}
示例3: ViewProAttackUpdate
public void ViewProAttackUpdate(SimulationEvent ev)
{
if (m_currentBehavior != null)
{
m_currentBehavior.ViewProAttackUpdate(ev);
}
}
示例4: TimeTick
private void TimeTick(SimulationEvent e)
{
foreach (StateDB.ActiveRegion region in StateDB.dynamicRegions.Values)
{
if (region.linkedObject == "")
continue; //don't draw unlinked regions
SimulationObjectProxy obProx = objectProxies[region.linkedObject];
//Calculate new absolute poly for region and send ViewPro event
LocationValue lvLoc = (LocationValue)obProx["Location"].GetDataValue();
Vec2D loc = new Vec2D(lvLoc);
if (!lvLoc.exists)
{
return; //possible that the tractor object doesn't exist, so don't show it.
}
Polygon3D absolutePoly = GetAbsolutePolygon(loc, region.poly.Footprint);
absolutePoly.TopZ = region.poly.TopZ;
absolutePoly.BottomZ = region.poly.BottomZ;
region.referencePoint = loc;
region.currentAbsolutePolygon = absolutePoly;
this.SendViewProActiveRegionUpdate(region.id, region.isVisible, region.displayColor, absolutePoly);
}
}
示例5: AddTextMessage
public void AddTextMessage(SimulationEvent e)
{
string msg = ((StringValue)e["ChatBody"]).value;
lock (streamLock)
{
textStream = String.Format("{0}\r\n{1}", msg, textStream);
}
}
示例6: ProcessEvent
public void ProcessEvent(SimulationEvent e)
{
objectProxies = bbClient.GetObjectProxies();
switch (e.eventType)
{
case "TimeTick":
TimeTick(e);
break;
default:
break;
}
}
示例7: PublishCPE
public static void PublishCPE(String dmId, double findFixCpe, double trackTargetCpe)
{
SimulationEvent cpe = new SimulationEvent();
cpe.eventType = "SEAMATE_UpdateCPE";
cpe.parameters.Add("DM_ID", DataValueFactory.BuildString(dmId));
cpe.parameters.Add("FF_CPE", DataValueFactory.BuildDouble(findFixCpe));
cpe.parameters.Add("TT_CPE", DataValueFactory.BuildDouble(trackTargetCpe));
if (_client == null)
throw new Exception("DDD Network Client not connected; You need to call Connect successfully before sending events.");
_client.PutEvent(cpe);
}
示例8: ScenarioData
public ScenarioData(SimulationEvent e)
{
MapFileName = ((StringValue)e["MapName"]).value;
UTMZone = "";
ScenarioName = ((StringValue)e["ScenarioName"]).value;
ScenarioDescription = ((StringValue)e["ScenarioDescription"]).value;
PlayerBrief = ((StringValue)e["PlayerBrief"]).value;
IconLibrary = ((StringValue)e["IconLibrary"]).value;
UTMEasting = ((DoubleValue)e["UTMEasting"]).value;
UTMNorthing = ((DoubleValue)e["UTMNorthing"]).value;
HorizontalMetersPerPixel = ((DoubleValue)e["HorizontalPixelsPerMeter"]).value;
VerticalMetersPerPixel = ((DoubleValue)e["VerticalPixelsPerMeter"]).value;
}
示例9: DeepCopy
/*
static public SimulationEvent DeepCopy(ref SimulationEvent e)
{
SimulationEvent n = new SimulationEvent();
n.eventType = e.eventType;
foreach (string p in e.parameters.Keys)
{
n.parameters[p] = e.parameters[p];
}
return n;
}
*/
static public string XMLSerialize(SimulationEvent e)
{
StringBuilder sb;
lock (e.eventLock)
{
sb = new StringBuilder(String.Format("<{0}>", e.eventType));
foreach (string key in e.parameters.Keys)
{
sb.Append(String.Format("<Parameter><Name>{0}</Name><Value>{1}</Value></Parameter>", key, DataValueFactory.XMLSerialize(e.parameters[key])));
}
sb.Append(String.Format("</{0}>", e.eventType));
}
return sb.ToString();
}
示例10: BuildEvent
static public SimulationEvent BuildEvent(ref SimulationModelInfo model, string eventType)
{
SimulationEvent e = new SimulationEvent();
if (!model.eventModel.events.ContainsKey(eventType))
{
throw new Exception("Event type doesn't exist");
}
foreach (ParameterInfo pInfo in model.eventModel.events[eventType].parameters.Values)
{
e[pInfo.name] = DataValueFactory.BuildValue(pInfo.dataType);
}
e.eventType = eventType;
return e;
}
示例11: ProcessEvent
public void ProcessEvent(SimulationEvent e)
{
//objectProxies = bbClient.GetObjectProxies();
switch (e.eventType)
{
case "TimeTick":
TimeTick(e);
break;
case "RevealObject":
RevealObject(e);
break;
case "SubplatformLaunch":
SubplatformLaunch(e);
break;
case "WeaponLaunch":
WeaponLaunch(e);
break;
case "SubplatformDock":
SubplatformDock(e);
break;
case "ExternalApp_SimStop":
ResetSimulation();
break;
case "StateChange":
StateChange(e);
break;
case "NewObject":
NewObject(e);
break;
case "WeaponLaunchFailure":
WeaponLaunchFailure(e);
break;
case "ClientAttackRequest":
ClientAttackRequest(e);
break;
case "ForceUpdateObjectAttribute":
ForceUpdateObjectAttribute(e);
break;
default:
break;
}
}
示例12: PutEvent
public void PutEvent(SimulationEvent e)
{
lock (distributorLock)
{
if (e.eventType == "TimeTick")
{
currentTimeTick = ((IntegerValue)e["Time"]).value;
}
e["Time"] = DataValueFactory.BuildInteger(currentTimeTick);
if (incoming == true)
{
AddToOutgoingQueues(e);
}
else
{
AddToIncomingQueue(e);
}
}
}
示例13: ProcessEvent
public void ProcessEvent(SimulationEvent e)
{
switch (e.eventType)
{
case "NewObject":
//System.Console.WriteLine(GetSimulatorName() + " recieved " + e.eventType);
NewObject(e);
break;
case "ExternalApp_SimStop":
ResetSimulation();
break;
case "TimeTick":
TimeTick(e);
break;
case "ForceUpdateObjectAttribute":
ForceUpdateObjectAttribute(e);
break;
default:
break;
}
}
示例14: AuthenticationRequest
public void AuthenticationRequest(SimulationEvent e)
{
Authenticator.LoadUserFile();
string terminalID = ((StringValue)e["TerminalID"]).value;
if (currentlyLoggedInUsers == maxNumberOfUsers)
{
SendAuthenticationResponse(terminalID, "The server has reached its limit for number of users attached to the DDD.", false);
return;
}
string username = ((StringValue)e["Username"]).value;
string password = ((StringValue)e["Password"]).value;
if (Authenticator.Authenticate(username, password))
{
SendAuthenticationResponse(terminalID, "Authentication successful!", true);
}
else
{
SendAuthenticationResponse(terminalID, "Invalid username and/or password", false);
}
}
示例15: ValidateEvent
static public bool ValidateEvent(ref SimulationModelInfo model, SimulationEvent e)
{
try
{
string eventType = e.eventType;
if (!model.eventModel.events.ContainsKey(eventType))
{
return false;
}
foreach (ParameterInfo pInfo in model.eventModel.events[eventType].parameters.Values)
{
if (!e.parameters.ContainsKey(pInfo.name))
{
return false;
}
if (e[pInfo.name].dataType != pInfo.dataType)
{
return false;
}
}
foreach (string attname in e.parameters.Keys)
{
if (!model.eventModel.events[eventType].parameters.ContainsKey(attname))
{
return false;
}
}
}
catch (Exception)
{
return false;
}
return true;
}