Пример #1
0
    void InitCommand(Robot rob, ServerRobotCommand robCmd, Command cmd)
    {
        robCmd.lastCmd = cmd;


        switch (cmd.cmdTyp)
        {
        case CommandType.MOVE_TO:
            robCmd.currPath     = lvlCtrl.AStarPath(rob.pos, new Vector2(cmd.goalPosX, cmd.goalPosY));
            robCmd.currPathIncr = -1;
            break;

        case CommandType.CHANGE_HEIGHT:


            break;

        case CommandType.GUARD:
//			float timeForGuarding = cmd.val;

            break;

        case CommandType.SET_ANGLE:
            rob.SetGoalAngle(cmd.val);
            break;

        default:
            break;
        }
    }
Пример #2
0
    List <Vector2> CalculateRoute(Vector2 robotPos, Vector2 clickPos)
    {
        List <Vector2> route = new List <Vector2>();

        route = lvlCtrl.AStarPath(robotPos, clickPos);
        return(route);
    }