sealed public override void Operation(RobotBase operatingRobotBase) { Speaker speaker = operatingRobotBase.GetRobotPart <Speaker>(); if (speaker != null) { speaker.Speak(this.Input1.GetReporterStringValue(operatingRobotBase)); } }
sealed public override void Operation(RobotBase operatingRobotBase) { JetEngine jetEngine = operatingRobotBase.GetRobotPart <JetEngine>(); if (jetEngine != null) { jetEngine.Destination = new Vector2(Input1.GetReporterNumberValue(operatingRobotBase), Input2.GetReporterNumberValue(operatingRobotBase)); } }
sealed public override void Operation(RobotBase operatingRobotBase) { JetEngine jetEngine = operatingRobotBase.GetRobotPart <JetEngine>(); if (jetEngine != null) { jetEngine.EnginePower = Input1.GetReporterNumberValue(operatingRobotBase); } }
sealed public override void Operation(RobotBase operatingRobotBase) { InternetAntenna internetAntenna = operatingRobotBase.GetRobotPart <InternetAntenna>(); if (internetAntenna != null) { internetAntenna.SendDataThroughInternet(Input1.GetReporterStringValue(operatingRobotBase), Input2.GetReporterStringValue(operatingRobotBase), Input3.GetReporterStringValue(operatingRobotBase)); } }
/// <summary> /// This called From InternetAntenna_SendCommandThroughInternet /// </summary> /// <param name="robotUniqueId">Robot unique identifier.</param> /// <param name="commandName">Command Name.</param> public void SendCommandThroughInternet(string robotUniqueId, string commandName) { RobotBase recieverRobotBase = RobotSystem.instance.GetSpawnedRobot(robotUniqueId); if (recieverRobotBase != null) { InternetAntenna recieverRobotInternetAntenna = recieverRobotBase.GetRobotPart <InternetAntenna>(); if (recieverRobotInternetAntenna != null) { // To Recieve Data from Other Robot through InternetAntenna, Receiver Robot Should have InternetAntenna Robot Part recieverRobotInternetAntenna.RecieveCommandThroughInternet(commandName); } } }
/// <summary> /// This called From InternetAntenna_SendDataThroughInternet /// </summary> /// <param name="robotUniqueId">Robot unique identifier.</param> /// <param name="variableKey">Variable key.</param> /// <param name="data">Data.</param> public void SendDataThroughInternet(string robotUniqueId, string variableKey, string data) { RobotBase recieverRobotBase = RobotSystem.instance.GetSpawnedRobot(robotUniqueId); if (recieverRobotBase != null) { InternetAntenna recieverRobotInternetAntenna = recieverRobotBase.GetRobotPart <InternetAntenna>(); if (recieverRobotInternetAntenna != null) { // To Recieve Data from Other Robot through InternetAntenna, Receiver Robot Should have InternetAntenna Robot Part recieverRobotInternetAntenna.RecieveDataThroughInternet(variableKey, data); } } }
public override string GetReporterStringValue(RobotBase operatingRobotBase) { JetEngine jetEngine = operatingRobotBase.GetRobotPart <JetEngine>(); if (jetEngine != null) { return(jetEngine.EnginePower.ToString()); } else { return(System.String.Empty); } }
public override string GetReporterStringValue(RobotBase operatingRobotBase) { GPS gps = operatingRobotBase.GetRobotPart <GPS>(); if (gps != null) { return(gps.GetRobotLocationX().ToString()); } else { return(System.String.Empty); } }