本文整理汇总了C#中IBasicRobot类的典型用法代码示例。如果您正苦于以下问题:C# IBasicRobot类的具体用法?C# IBasicRobot怎么用?C# IBasicRobot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IBasicRobot类属于命名空间,在下文中一共展示了IBasicRobot类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Dispatch
internal override void Dispatch(IBasicRobot robot, IRobotStaticsN statics, IGraphics graphics)
{
IBasicEvents listener = robot.GetBasicEventListener();
if (listener != null)
{
listener.OnRobotDeath(this);
}
}
示例2: Dispatch
internal override void Dispatch(IBasicRobot robot, IRobotStaticsN statics, IGraphics graphics)
{
if (robot != null)
{
var listener = robot.GetBasicEventListener() as IBasicEvents2;
if (listener != null)
{
listener.OnBattleEnded(this);
}
}
}
示例3: Dispatch
internal override void Dispatch(IBasicRobot robot, IRobotStaticsN statics, IGraphics graphics)
{
if (statics.IsInteractiveRobot())
{
IInteractiveEvents listener = ((IInteractiveRobot) robot).GetInteractiveEventListener();
if (listener != null)
{
listener.OnMouseWheelMoved(this);
}
}
}
示例4: Dispatch
internal override void Dispatch(IBasicRobot robot, IRobotStaticsN statics, IGraphics graphics)
{
if (statics.IsAdvancedRobot())
{
IAdvancedEvents listener = ((IAdvancedRobot) robot).GetAdvancedEventListener();
if (listener != null)
{
listener.OnSkippedTurn(this);
}
}
}
示例5: Dispatch
internal override void Dispatch(IBasicRobot robot, IRobotStaticsN statics, IGraphics graphics)
{
if (statics.IsPaintRobot())
{
IPaintEvents listener = ((IPaintRobot) robot).GetPaintEventListener();
if (listener != null)
{
listener.OnPaint(graphics);
}
}
}
示例6: Dispatch
internal override void Dispatch(IBasicRobot robot, IRobotStaticsN statics, IGraphics graphics)
{
if (statics.IsTeamRobot())
{
ITeamEvents listener = ((ITeamRobot) robot).GetTeamEventListener();
if (listener != null)
{
listener.OnMessageReceived(this);
}
}
}
示例7: Dispatch
internal override sealed void Dispatch(IBasicRobot robot, IRobotStaticsN statics, IGraphics graphics)
{
if (robot != null)
{
IBasicEvents3 listener = robot.GetBasicEventListener() as IBasicEvents3;
if (listener != null)
{
listener.OnRoundEnded(this);
}
}
}
示例8: loadRobotRound
private bool loadRobotRound()
{
robot = null;
try
{
object instance = Activator.CreateInstance(robotType);
robot = instance as IBasicRobot;
if (robot == null)
{
println("SYSTEM: Skipping robot: " + statics.getName());
return false;
}
robot.SetOut(output);
robot.SetPeer((IBasicRobotPeer) this);
Console.SetOut(output);
Console.SetError(output);
eventManager.SetRobot(robot);
}
catch (MissingMethodException e)
{
punishSecurityViolation(statics.getName() + " " + e.Message);
return false;
}
catch (SecurityException e)
{
punishSecurityViolation(statics.getName() + " " + e.Message);
return false;
}
catch (Exception e)
{
if (e.InnerException is SecurityException)
{
}
println("SYSTEM: An error occurred during initialization of " + statics.getName());
println("SYSTEM: " + e);
println(e);
robot = null;
LoggerN.logMessage(e);
return false;
}
return true;
}
示例9: Dispatch
public static void Dispatch(Event evnt, IBasicRobot robot, IRobotStaticsN statics, IGraphics graphics)
{
eventHelper.Dispatch(evnt, robot, statics, graphics);
}
示例10: SetRobot
/// <summary>
/// Sets the robot that will receive events dispatched from the event queue.
/// </summary>
/// <param name="robot">is the robot that will receive event dispatched from the event queue.</param>
public void SetRobot(IBasicRobot robot)
{
this.robot = robot;
}
示例11: setRobot
public void setRobot(IBasicRobot r)
{
robot = r;
}
示例12: cleanup
public virtual void cleanup()
{
robot = null;
// Remove the file system and the manager
robotFileSystemManager.cleanup();
robotFileSystemManager = null;
}
示例13: Cleanup
/// <summary>
/// Cleans up the event queue.
/// </summary>
/// <remarks>
/// This method should be called when the event queue is no longer needed,
/// i.e. before it must be garbage collected.
/// </remarks>
public void Cleanup()
{
// Remove all events
Reset();
// Remove all references to robots
robot = null;
robotProxy = null;
}