void spawnCourse()
    {
        GameObject Square_1;
        int        max = UnityEngine.Random.Range(15, 20);
        int        i   = 0;
        int        rp  = 0;

        ButtonManager.numPlayers = 1;
        while (i < max)
        {
            int c = UnityEngine.Random.Range(9, 57);
            //Debug.Log(c);
            if (WallPlacement.validPlacement(c))
            {
                Square_1 = GameObject.Find(c.ToString());
                GameObject SolidWall = (GameObject)Instantiate(Resources.Load("SolidWall"));
                SolidWall.transform.SetParent(Square_1.transform);
                SolidWall.GetComponent <Draggable>().enabled = false;
                i++;
                rp = 0;
            }
            else
            {
                rp++;
            }
            if (rp == 10)
            {
                break;
            }
        }
    }
Exemple #2
0
 private void Awake()
 {
     //waterMesh = GetComponent<WaterMesh>();
     delaunayMesh  = GetComponent <DelaunayMesh>();
     wallPlacement = GetComponent <WallPlacement>();
     entireCSVData = CSV_extended.ParseCsvFileUsingResources(pathToCSV);
     generateMeshButton.interactable = true;
     informationCanvas.enabled       = false;
     settingsCanvas.enabled          = false;
     aRTransformationManager         = ARTransformationManager.Instance;
     aRLocationProvider = ARLocationProvider.Instance;
     DisableInformationText();
 }
Exemple #3
0
    // If the player gets stuck after completing all tasks, the following method will be invoked.
    // For example, if he goes to the upper cell, where he will be surrounded by walls in front, right, left, except his back, then it means that he gets stuck.
    bool StuckInDeadline(string direction)
    {
        string wallDirection = "Wall_At_Column" + playerPosX.ToString() + "_Row" + playerPosZ.ToString();

        WallPlacement wallPlacement = getWallDirections(wallDirection);

        switch (direction)
        {
        case "up":
            if (wallPlacement.WallFront && wallPlacement.WallRight && wallPlacement.WallLeft)
            {
                return(true);
            }
            break;

        case "down":
            if (wallPlacement.WallBack && wallPlacement.WallRight && wallPlacement.WallLeft)
            {
                return(true);
            }
            break;

        case "right":
            if (wallPlacement.WallFront && wallPlacement.WallBack && wallPlacement.WallRight)
            {
                return(true);
            }
            break;

        case "left":
            if (wallPlacement.WallFront && wallPlacement.WallBack && wallPlacement.WallLeft)
            {
                return(true);
            }
            break;
        }
        return(false);
    }
    public void OnEndDrag(PointerEventData eventData)
    {
        DropZone.DropZoneType zone = DropZone.zone;
        //Debug.Log("OnEndDrag");
        //Debug.Log(zone);
        if (zone == DropZone.DropZoneType.BoardZone)
        {
            if (this.transform.tag != "SolidWall" && this.transform.tag != "IceWall")
            {
                this.transform.SetParent(originParent.transform);
            }
            else
            {
                if (parentToReturnTo.transform.childCount == 0)
                {
                    if (this.transform.tag == "SolidWall")
                    {
                        //Debug.Log("Solid wall placed");
                        this.transform.SetParent(parentToReturnTo);
                        tileChildCount++;
                        if (WallPlacement.validPlacement(Convert.ToInt32(parentToReturnTo.transform.name)))
                        {
                            //Debug.Log("Solid wall placed");
                            this.transform.SetParent(parentToReturnTo);
                            tileChildCount++;
                        }
                        else
                        {
                            this.transform.SetParent(originParent.transform);
                        }                                                         //*/ //not vallid placement
                    }
                    else
                    {
                        //Debug.Log("Ice wall placed");
                        this.transform.SetParent(parentToReturnTo);
                        tileChildCount++;
                    }
                }
                else
                {
                    this.transform.SetParent(originParent.transform);
                }                                                            //space occupied cant place wall there
            }
            this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
            GetComponent <CanvasGroup>().blocksRaycasts = true;
            Destroy(placeholder);
        }
        else if (zone == DropZone.DropZoneType.FunctionZone)
        {
            //Debug.Log("in function zone");
            if (this.tag != "Forward" && this.tag != "Left" && this.tag != "Right" && this.tag != "Laser" && this.tag != "FCard")
            {
                this.transform.SetParent(originParent.transform);
                this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
                GetComponent <CanvasGroup>().blocksRaycasts = true;
                Destroy(placeholder);
            }
            else
            {
                Scene scene = SceneManager.GetActiveScene();
                //Debug.Log(scene);
                if (scene.name == "spgameBoard2")
                {
                    Debug.Log(scene.name);
                    this.transform.SetParent(parentToReturnTo);
                    this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
                    GetComponent <CanvasGroup>().blocksRaycasts = true;
                    this.GetComponent <Draggable>().enabled     = false;
                    Destroy(placeholder);
                }
                else
                {
                    this.transform.SetParent(parentToReturnTo);
                    this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
                    GetComponent <CanvasGroup>().blocksRaycasts = true;
                    this.GetComponent <Draggable>().enabled     = false;
                    Sprite blankCard = Resources.Load <Sprite>("blank_card");
                    this.GetComponent <Image>().sprite = blankCard;
                    Destroy(placeholder);
                }
            }
        }
        else if (zone == DropZone.DropZoneType.HandZone)
        {
            originParent = GameObject.Find("Hand");
            this.transform.SetParent(originParent.transform);
            //this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
            GetComponent <CanvasGroup>().blocksRaycasts = true;
            Destroy(placeholder);
        }
        else if (zone == DropZone.DropZoneType.DeckZone)
        {
            this.transform.SetParent(parentToReturnTo);
            this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
            GetComponent <CanvasGroup>().blocksRaycasts = true;
            Destroy(placeholder);
        }
        else if (zone == DropZone.DropZoneType.FieldZone)
        {
            this.transform.SetParent(parentToReturnTo);
            this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
            GetComponent <CanvasGroup>().blocksRaycasts = true;
            Destroy(placeholder);
        }
        else if (zone == DropZone.DropZoneType.TileZone)
        {
            if (this.transform.tag != "SolidWall" && this.transform.tag != "IceWall")
            {
                this.transform.SetParent(originParent.transform);
                this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
                GetComponent <CanvasGroup>().blocksRaycasts = true;
                Destroy(placeholder);
            }
            else
            {
                this.transform.SetParent(parentToReturnTo);
                this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
                GetComponent <CanvasGroup>().blocksRaycasts = true;
                Destroy(placeholder);
            }
        }
        else if (zone == DropZone.DropZoneType.DiscardZone)
        {
            if (this.tag != "Forward" && this.tag != "Left" && this.tag != "Right" && this.tag != "Laser")
            {
                this.transform.SetParent(originParent.transform);
                this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
                GetComponent <CanvasGroup>().blocksRaycasts = true;
                Destroy(placeholder);
            }
            else
            {
                this.transform.SetParent(parentToReturnTo);
                this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
                GetComponent <CanvasGroup>().blocksRaycasts = true;
                this.GetComponent <Draggable>().enabled     = false;
                Sprite blankCard = Resources.Load <Sprite>("blank_card");
                this.GetComponent <Image>().sprite = blankCard;
                Destroy(this.gameObject);
                Destroy(placeholder);
            }
        }
        else if (zone == DropZone.DropZoneType.FCardZone)
        {
            if (this.tag != "Forward" && this.tag != "Left" && this.tag != "Right" && this.tag != "Laser")
            {
                this.transform.SetParent(originParent.transform);
                this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
                GetComponent <CanvasGroup>().blocksRaycasts = true;
                Destroy(placeholder);
            }
            else
            {
                if (GameObject.Find("FCard").transform.childCount < 5)
                {
                    this.transform.SetParent(parentToReturnTo);
                    //this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
                    GetComponent <CanvasGroup>().blocksRaycasts = true;
                    this.GetComponent <Draggable>().enabled     = false;
                    Destroy(placeholder);
                }
                else
                {
                    this.transform.SetParent(originParent.transform);
                    this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
                    GetComponent <CanvasGroup>().blocksRaycasts = true;
                    Destroy(placeholder);
                }
            }
        }
        else
        {
            this.transform.SetParent(parentToReturnTo);
            this.transform.SetSiblingIndex(placeholder.transform.GetSiblingIndex());
            GetComponent <CanvasGroup>().blocksRaycasts = true;
            Destroy(placeholder);
        }
        DropZone.zone = DropZone.DropZoneType.empty;
        Scene s = SceneManager.GetActiveScene();

        if (s.name != "spgameBoard2")
        {
            if (tileChildCount > GameObject.Find("TileZone").transform.childCount)
            {
                //Debug.Log("Disabling Hand");
                GameObject.Find("Function").transform.GetComponent <DropZone>().enabled = false;
                //Debug.Log("Disabling TileZone");
                foreach (Transform child in GameObject.Find("TileZone").transform)
                {
                    child.GetComponent <Draggable>().enabled = false;
                }
                //Debug.Log("Disabling Run Function");
                GameObject.Find("runFunctionBUtton").transform.GetComponent <Button>().enabled = false;
            }

            if (handChildCount > GameObject.Find("Hand").transform.childCount)
            {
                //Debug.Log("Disabling TileZone");
                Scene scene = SceneManager.GetActiveScene();
                if (scene.name != "spgameBoard2")
                {
                    foreach (Transform child in GameObject.Find("TileZone").transform)
                    {
                        child.GetComponent <Draggable>().enabled = false;
                    }
                }
                GameObject.Find("runFunctionBUtton").transform.GetComponent <Button>().enabled = false;
            }
        }
    }
Exemple #5
0
    void FixedUpdate()
    {
        /* This is to ensure that all data was saved after entering previous task. However, take a note,
         * that all data must be erased, when the player enters the labyrinth for the first time.
         * Otherwise, worst scenario might happen. */

        if (!gameHasStarted)
        {
            taskLevel      = PlayerPrefs.GetInt("taskLevel", 1);                 // If the player makes 6 turns in the maze, the new task with an appropriate level will be spawned. So this is required to record current task level.
            previousStep   = PlayerPrefs.GetString("previousStep", "firstStep"); // Take a look in FixedUpdate () about this variable.
            turnsCount     = PlayerPrefs.GetInt("turnsCount", 0);
            playerPosX     = PlayerPrefs.GetInt("playerPosX", 0);
            playerPosZ     = PlayerPrefs.GetInt("playerPosZ", 0);
            completedTasks = PlayerPrefs.GetInt("CompletedTasks", 0);
            string     startingFloorName = "Floor_Column" + playerPosX.ToString() + "_Row" + playerPosZ.ToString();         // It will get the player to the cell, where he was previously stopped, once after he entered to the task scene.
            GameObject startingFloor     = GameObject.Find(startingFloorName);
            if (startingFloor != null)
            {
                transform.position = startingFloor.transform.position;
            }
            if (PlayerPrefs.GetInt("RowsCount", 0) != 0 && PlayerPrefs.GetInt("ColumnsCount", 0) != 0)
            {
                RowsCount    = PlayerPrefs.GetInt("RowsCount", 0);
                ColumnsCount = PlayerPrefs.GetInt("ColumnsCount", 0);
            }
            gameHasStarted = true;

            // After the player returns to the maze once again, the same portals with the same previous locations will be spawned.
            for (int i = 1; i < taskLevel; i++)
            {
                string nameIdentifier = "TaskPortal " + i;
                initTaskPortal(new Vector3(PlayerPrefs.GetFloat(nameIdentifier + "_PosX", 0), 0, PlayerPrefs.GetFloat(nameIdentifier + "_PosZ", 0)), i);
                GameObject taskPortal = GameObject.Find(nameIdentifier);
                if (taskPortal != null && taskPortal.transform.position == transform.position)
                {
                    enteredTask = taskPortal;
                    enteredTask.SetActive(false);                           // We have to hide the task portal, if the player is spawned on the same location as the task portal.
                    enteredTask.GetComponent <Collider> ().enabled = false; // and also turn off its collider, so ball won't bounce off, once hits it.
                }
            }
        }

        string wallDirection = "Wall_At_Column" + playerPosX.ToString() + "_Row" + playerPosZ.ToString();

        WallPlacement wallPlacement = getWallDirections(wallDirection);

        string     floorName = "Floor_Column" + playerPosX.ToString() + "_Row" + playerPosZ.ToString();
        GameObject floor     = GameObject.Find(floorName);

        if (floor != null)
        {
            //This snippet of code is required to identify whether the task is in the range of the current cell.

            foreach (GameObject taskPortal in taskPortals)
            {
                if (floor.transform.position == taskPortal.transform.position && taskPortal.activeSelf)
                {
                    turnsCount = 0;                     // we have to nullify the turns count

                    // This will get the length of TaskPortal, because once I named the mesh by this exact name that the player can go through to the next task,
                    // and substring it in such way that it will receive the task level, that the player currently intends to play. For example TaskPortal1,
                    // will leave just number '1', and the task 1 will be launched.
                    taskToComplete = Int32.Parse(taskPortal.name.Substring("TaskPortal".Length, taskPortal.name.Length - "TaskPortal".Length));
                    taskPortal.SetActive(false);                           // We have to hide the task portal, if the player stays on the same location as the task portal.
                    taskPortal.GetComponent <Collider> ().enabled = false; // and also turn off its collider, so ball won't bounce off, once hits it.
                    enteredTask = taskPortal;

                    // If the player enters the task portal, the notification will pop up, if ok button is clicked, it will proceed to the task.
                    switch (taskToComplete)
                    {
                    case 1:
                        NotificationOptions("Вы хотите сыграть в Викторину?");
                        break;

                    case 2:
                        NotificationOptions("Вы хотите сыграть в Игру Слов?");
                        break;

                    case 3:
                        NotificationOptions("Вы хотите сыграть в Классификацию?");
                        break;

                    case 4:
                        NotificationOptions("Вы хотите сыграть в Ассоциацию?");
                        break;
                    }
                    break;
                }
            }

            if (defaultFloorColor == null)
            {
                defaultFloorColor = floor.GetComponent <Renderer> ().material.color;
            }

            floor.GetComponent <Renderer> ().material.color = Color.green;            // current staying floor color

            // the player can make his moves after each second

            timer -= Time.deltaTime;

            if (allowMotion)
            {
                transform.position = Vector3.Lerp(transform.position, floor.transform.position, moveSpeed * Time.deltaTime);                  // this allows ball to move smoothly to the target
                if (timer <= 0)
                {
                    allowMotion = false;
                }
                // The current location of the player must be recorded, so on the next session the player is spawned on the same previous location. The same applies to the previous made step and number of turns.
                PlayerPrefs.SetString("previousStep", previousStep);
                PlayerPrefs.SetInt("turnsCount", turnsCount);
                PlayerPrefs.SetInt("playerPosX", playerPosX);
                PlayerPrefs.SetInt("playerPosZ", playerPosZ);
            }

            if (timer <= 0 && !allowMotion)
            {
                // previousStep is required to record the two-based steps for the player, so by this we can know whether the player will make a "turn".
                // turnsCount records information about how much turns were made by the player.
                // The following turns are available by the player, the previous step will record the first turn, and will compare it with current step:
                // ↑ + → |-------| ↓ + → |-------| → + ↑ |-------| → + ↓
                // ↑ + ← |-------| ↓ + ← |-------| ← + ↑ |-------| ← + ↓

                if (previousStep == null)
                {
                    previousStep = "firstStep";
                }
                Vector3 moveVector = (Vector3.back * joystick.Horizontal + Vector3.right * joystick.Vertical).normalized * moveSpeed;

                // The maze is defined in x and z manner. So z++ means the player goes up, z-- down, x++ right, x-- left.

                if (moveVector.x >= 5 & moveVector.x <= 10 && moveVector.z >= -3 && moveVector.z <= 3)                                       // The player moves joystick upwards
                {
                    if (playerPosZ + 1 < RowsCount && !wallPlacement.WallFront)                                                              // If the player makes his move to upper cell, we must ensure, that no wall in front exists, and the boundary is kept, so the system won't throw an error.
                    {
                        floor.GetComponent <Renderer> ().material.color = defaultFloorColor;                                                 // If the player moves to the next cell, the previous cell will change its color to its default.
                        if (taskLevel <= maxAvailableTasks && previousStep != "firstStep" && previousStep != "up" && previousStep != "down") // Take a look to all available turns of the player above. If and only the tasks are not completed the turns will be counted. "firstStep", iterative turns, reversed turns are not counted as a turn.
                        {
                            turnsCount++;
                        }
                        previousStep = "up";
                        playerPosZ++;                            // if the player makes his move up, so it will go to the upper cell
                        if (completedTasks == maxAvailableTasks) // Once all tasks are completed, the player will have to go to the exit, if he gets stuck the sound should play notifying him that this cell is the deadline.
                        {
                            if (StuckInDeadline("up"))
                            {
                                Debug.Log("You're stuck!");                                  // Here you stuck, and the sound should play
                            }
                        }
                        allowMotion = true;
                        timer       = 1.0;
                        checkForEnteredTask(floor);
                    }
                }
                else if (moveVector.x >= -10 & moveVector.x <= -5 && moveVector.z >= -3 && moveVector.z <= 3)                     // Downwards
                {
                    if (playerPosZ - 1 > -1 && !wallPlacement.WallBack)
                    {
                        floor.GetComponent <Renderer> ().material.color = defaultFloorColor;
                        if (taskLevel <= maxAvailableTasks && previousStep != "firstStep" && previousStep != "down" && previousStep != "up")
                        {
                            turnsCount++;
                        }
                        previousStep = "down";
                        playerPosZ--;
                        if (completedTasks == maxAvailableTasks)
                        {
                            if (StuckInDeadline("down"))
                            {
                                Debug.Log("You're stuck!");
                            }
                        }
                        allowMotion = true;
                        timer       = 1.0;
                        checkForEnteredTask(floor);
                    }
                }

                if (moveVector.x >= -3 & moveVector.x <= 3 && moveVector.z >= -10 && moveVector.z <= -5)                   // Right
                {
                    if (playerPosZ == RowsCount - 1 && playerPosX == ColumnsCount - 1)
                    {
                        // Once we exit from the labyrinth, we ensure that all data is deleted
                        foreach (string key in keysToDelete)
                        {
                            if (key == "Wall_At_Column")
                            {
                                for (int row = 0; row < RowsCount; row++)
                                {
                                    for (int column = 0; column < ColumnsCount; column++)
                                    {
                                        string Wall_At_Column = "Wall_At_Column" + column.ToString() + "_Row" + row.ToString();
                                        PlayerPrefs.DeleteKey(Wall_At_Column + "_Right");
                                        PlayerPrefs.DeleteKey(Wall_At_Column + "_Front");
                                        PlayerPrefs.DeleteKey(Wall_At_Column + "_Left");
                                        PlayerPrefs.DeleteKey(Wall_At_Column + "_Back");
                                    }
                                }
                            }
                            else if (key == "TaskPortal")
                            {
                                for (int i = 1; i <= maxAvailableTasks; i++)
                                {
                                    PlayerPrefs.DeleteKey(key + i + "_PosX");
                                    PlayerPrefs.DeleteKey(key + i + "_PosZ");
                                }
                            }
                            else
                            {
                                PlayerPrefs.DeleteKey(key);
                            }
                        }
                        SceneManager.LoadScene("Exit");                          // Go to the stage where final comics scene will be presented to the player
                    }
                    else if (playerPosX + 1 < ColumnsCount && !wallPlacement.WallRight)
                    {
                        floor.GetComponent <Renderer> ().material.color = defaultFloorColor;
                        if (taskLevel <= maxAvailableTasks && previousStep != "firstStep" && previousStep != "right" && previousStep != "left")
                        {
                            turnsCount++;
                        }
                        previousStep = "right";
                        playerPosX++;
                        if (completedTasks == maxAvailableTasks)
                        {
                            if (StuckInDeadline("right"))
                            {
                                Debug.Log("You're stuck!");
                            }
                        }
                        allowMotion = true;
                        timer       = 1.0;
                        checkForEnteredTask(floor);
                    }
                }
                else if (moveVector.x >= -3 & moveVector.x <= 3 && moveVector.z >= 5 && moveVector.z <= 10)                     // Left
                {
                    if (playerPosX - 1 > -1 && !wallPlacement.WallLeft)
                    {
                        floor.GetComponent <Renderer> ().material.color = defaultFloorColor;
                        if (taskLevel <= maxAvailableTasks && previousStep != "firstStep" && previousStep != "left" && previousStep != "right")
                        {
                            turnsCount++;
                        }
                        previousStep = "left";
                        playerPosX--;
                        if (completedTasks == maxAvailableTasks)
                        {
                            if (StuckInDeadline("left"))
                            {
                                Debug.Log("You're stuck!");
                            }
                        }
                        allowMotion = true;
                        timer       = 1.0;
                        checkForEnteredTask(floor);
                    }
                }

                // this is where the new task is generated.
                if (turnsCount == 5)
                {
                    string availableFloorName;
                    int    xOffset = 0, zOffset = 0;                  // these are required to generate mesh, in the cell next to the current player position.

                    wallDirection = "Wall_At_Column" + playerPosX.ToString() + "_Row" + playerPosZ.ToString();
                    wallPlacement = getWallDirections(wallDirection);

                    if (previousStep == "up" || previousStep == "down")                       // if the player made his previous move towards up or down, the mesh will be generated to the next appropriate direction.
                    {
                        if (previousStep == "up" && !wallPlacement.WallFront)
                        {
                            zOffset = 1;
                        }
                        else if (previousStep == "down" && !wallPlacement.WallBack)
                        {
                            zOffset = -1;
                        }
                        else if (!wallPlacement.WallRight)
                        {
                            xOffset = 1;
                        }
                        else if (!wallPlacement.WallLeft)
                        {
                            xOffset = -1;
                        }
                    }
                    else if (previousStep == "right" || previousStep == "left")
                    {
                        if (!wallPlacement.WallFront)
                        {
                            zOffset = 1;
                        }
                        else if (!wallPlacement.WallBack)
                        {
                            zOffset = -1;
                        }
                        else if (previousStep == "right" && !wallPlacement.WallRight)
                        {
                            xOffset = 1;
                        }
                        else if (previousStep == "left" && !wallPlacement.WallLeft)
                        {
                            xOffset = -1;
                        }
                    }

                    availableFloorName = "Floor_Column" + (playerPosX + xOffset).ToString() + "_Row" + (playerPosZ + zOffset).ToString();
                    GameObject nextFloor = GameObject.Find(availableFloorName);

                    // We have to check whether the task is not generated in the same place as the previous one.
                    foreach (GameObject taskPortal in taskPortals)
                    {
                        if (taskPortal.transform.position == new Vector3(nextFloor.transform.position.x, 0, nextFloor.transform.position.z))
                        {
                            turnsCount--;
                            break;
                        }
                    }

                    if (turnsCount == 5)
                    {
                        turnsCount = 0;
                        initTaskPortal(nextFloor.transform.position, taskLevel);
                        GameObject taskPortal = taskPortals[taskPortals.Count - 1];                       // It will get the last created task portal, and record its location & taskLevel.
                        taskLevel++;
                        PlayerPrefs.SetFloat(taskPortal.name + "_PosX", taskPortal.transform.position.x);
                        PlayerPrefs.SetFloat(taskPortal.name + "_PosZ", taskPortal.transform.position.z);
                        PlayerPrefs.SetInt("taskLevel", taskLevel);
                    }
                }
            }
        }

        if (ViewCamera != null)
        {
            Vector3    direction = (Vector3.up * 2 + Vector3.back) * 2;
            RaycastHit hit;
            Debug.DrawLine(viewCameraPosition, viewCameraPosition + direction, Color.red);
            ViewCamera.transform.position = new Vector3(viewCameraPosition.x, viewCameraPosition.y, viewCameraPosition.z);
            ViewCamera.transform.LookAt(viewCameraPosition);             // this is how camera will look to the player position or any other defined position.
        }
    }