Exemple #1
0
        public RobotStrategy Get(string robotId)
        {
            var   reader = new RobotReader();
            Robot robot  = reader.GetRobotInfo(robotId);

            return(robot.RobotStrategy);
        }
Exemple #2
0
        public bool Login(string robotId)
        {
            var   reader = new RobotReader();
            Robot robot  = reader.GetRobotInfo(robotId);

            return(robot != null);
        }
Exemple #3
0
        public void Remove(string robotId)
        {
            var   reader = new RobotReader();
            Robot robot  = reader.GetRobotInfo(robotId);

            robot.RobotStrategy.Strategy.RemoveAt(robot.RobotStrategy.Strategy.Count - 1);

            var writer = new StrategyWriter();

            writer.UpdateStrategy(robot.RobotId, robot.RobotStrategy);
        }
Exemple #4
0
        public void Update(string robotId, Action action, ActionStrength level)
        {
            var   reader = new RobotReader();
            Robot robot  = reader.GetRobotInfo(robotId);

            robot.RobotStrategy.Strategy.Add(new RobotTurn {
                Action = action, Level = level
            });

            var writer = new StrategyWriter();

            writer.UpdateStrategy(robot.RobotId, robot.RobotStrategy);
        }
        /// <summary>
        /// Reads a robot file into a GopherRobot class from a path. Make sure you have defined the progress delegate.
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static GopherRobot ReadRobot(string path)
        {
            ProgressCallback("Loading file into memory...");
            var reader = new RobotReader(path);

            ProgressCallback("Pre-Processing loaded file...");
            reader.PreProcess();
            ProgressCallback("Pre-Processing STL meshes...");
            reader.PreProcessSTL();
            ProgressCallback("Processing Meshes...");
            reader.ProcessSTL();
            ProgressCallback("Processing Joints...");
            reader.ProcessJoints();
            ProgressCallback("Processing joint drivers...");
            reader.ProcessDrivers();
            ProgressCallback("Generating node tree...");
            return(RobotNodeGenerator.RobotFactory(reader.Robot));
        }
Exemple #6
0
        public void RegisterRobot(string robotId, PlayType playType)
        {
            var reader = new RobotReader();

            Robot robot = reader.GetRobotInfo(robotId);

            robot.PlayType = playType;
            robot.Status   = new RobotStatus();

            Robots.Add(robot);

            if (Robots.Count == BattleFieldCapacity)
            {
                SetRobotsEnemies();
            }

            robot.Ready = true;
        }