/// <summary> /// Static helper method to create a bot based on saved data /// </summary> /// <param name="botID">The ID of the bot to load</param> /// <returns>The bot</returns> public static Bot CreateExisting(Guid botID) { Bot bot = new Bot(); bot.os = new OS(FileHelper.LoadOS(botID)); bot.eprom = FileHelper.LoadROM(botID); bot.sensorArray = new SensorArray(bot.eprom.CommunicationType, bot.eprom.BumpSensors); bot.driveTrain = new DriveTrain(2, 1); bot.BindEvents(); return(bot); }
/// <summary> /// Static helper method to create a new Gen Zero bot /// </summary> /// <param name="commType">The bots communication type</param> /// <returns>The new bot</returns> public static Bot CreateGenZero(Enums.CommunicationTypes commType) { Bot bot = new Bot(); Guid botID = Guid.NewGuid(); bot.os = new OS(botID, true); bot.eprom = new EPROM(botID, commType, allBumpSensors); bot.sensorArray = new SensorArray(commType, allBumpSensors); bot.driveTrain = new DriveTrain(2, 1); bot.BindEvents(); return(bot); }