Exemple #1
0
        /// <summary>
        /// Load the robot
        /// </summary>
        /// <param name="name">The name of the robot (not the fileName and path).</param>
        public void Load(string name, int squadNumber, int team, byte[][] map)
        {
            // Fix wrong calls although this should not be valid as name
            name = System.IO.Path.GetFileNameWithoutExtension(name);
            Console.WriteLine(appDomain.SetupInformation.ApplicationBase);
            if (!System.IO.File.Exists(System.IO.Path.Combine(appDomain.SetupInformation.ApplicationBase, String.Format("{0}.dll", name))))
            {
                throw new MarvinsArenaException(String.Format("Robot not found!\n{0}", name));
            }

            AssemblyName = name;

            RobotHost robotHost = (RobotHost)Activator.CreateInstanceFrom(appDomain, Assembly.GetExecutingAssembly().Location, typeof(RobotHost).FullName).Unwrap();

            robotHost.LoadAssembly(name, squadNumber, team, map);
            this.RobotHost = robotHost;
        }
Exemple #2
0
 public GameObjectRobot(RobotLoader loader)
 {
     this.loader = loader;
     robotHost   = loader.RobotHost;
 }