Skip to content

Commit

Permalink
docs(general): Manual Content: DS Grids page should not describe grid…
Browse files Browse the repository at this point in the history
…s as a type of array

YoYoGames/GameMaker-Bugs#6860
  • Loading branch information
gurpreetsinghmatharoo committed Jul 31, 2024
1 parent 049330e commit 158ab44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1 id="h"><span data-field="title" data-format="default">DS Grids</span></h1>
<p>A DS grid is a type of<span> <a href="../../../GML_Overview/Arrays.htm">array</a> with 2 dimensions</span>. You define the grid by setting its integer width and height, which sets the total number of &quot;cells&quot; within the grid (the width and height multiplied). These cells are then used to hold different data values (real numbers or strings).</p>
<p>A DS grid is a data structure that stores information across<span> 2 dimensions</span>. You define the grid by setting its integer width and height, which sets the total number of &quot;cells&quot; within the grid (the width and height multiplied). These cells are then used to hold different data values (real numbers or strings).</p>
<p><img alt="DS Grid Example" class="center" src="../../../../assets/Images/Scripting_Reference/GML/Reference/Data_Structures/ds_grid_basic.png" />This type of structure allows you to set and retrieve the value of cells in the grid by giving the x and y index of it (which starts with 0 for both the x and the y axis and goes up to the width - 1 and the height -1). But you can also set the value in specific grid regions, add single values, and retrieve the sum, maximum, minimum, and mean value over a given region, making this data structure the most versatile of all those available to you.</p>
<p>When accessing DS grid data structures, you should always try to use <b>integer values</b> for the cell position, and all non-integer indices will be floored by <span data-keyref="GameMaker Name">GameMaker</span> if you do not. If that is not what you require, then you will need to do the rounding yourself previously before passing the index that you wish to check.<b></b></p>
<div data-conref="../../../../assets/snippets/Note_DS_Destroy_When_No_Longer_Needed.hts"> </div>
Expand Down Expand Up @@ -70,7 +70,8 @@ <h3 id="func_ref_serialisation">Serialisation</h3>
</ul>
<h3 id="func_ref_mp_grid">MP Grid</h3>
<ul class="colour">
<li><a data-xref="{title}" href="ds_grid_to_mp_grid.htm">ds_grid_to_mp_grid</a> / <a data-xref="{title}" href="../../Movement_And_Collisions/Motion_Planning/mp_grid_to_ds_grid.htm">mp_grid_to_ds_grid</a></li>
<li><a data-xref="{title}" href="ds_grid_to_mp_grid.htm">ds_grid_to_mp_grid</a></li>
<li><a data-xref="{title}" href="../../Movement_And_Collisions/Motion_Planning/mp_grid_to_ds_grid.htm">mp_grid_to_ds_grid</a></li>
</ul>
<p> </p>
<p> </p>
Expand All @@ -81,7 +82,7 @@ <h3 id="func_ref_mp_grid">MP Grid</h3>
<div style="float:right">Next: <a data-xref="{title}" href="../DS_Lists/DS_Lists.htm">DS Lists</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
DS Grids
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<body>
<!--<div class="body-scroll" style="top: 150px;">-->
<h1><span data-field="title" data-format="default">DS Lists</span></h1>
<p>A DS list is a data structure that stores information sequentially as it is added (much like an <a href="../../../GML_Overview/Arrays.htm">array</a>). DS lists are very flexible data structures that permit you to add values at the end or insert them somewhere in the middle of the list, as well as giving you the ability to shuffle the order (to randomise the values) or sort them in an ascending or descending order.</p>
<p>A DS list is a data structure that stores information sequentially as it is added (similar to an <a href="../../../GML_Overview/Arrays.htm">array</a>). DS lists are very flexible data structures that permit you to add values at the end or insert them somewhere in the middle of the list, as well as giving you the ability to shuffle the order (to randomise the values) or sort them in an ascending or descending order.</p>
<p class="note"><strong><span data-conref="../../../../assets/snippets/Tag_note.hts"> </span></strong> It is recommended to use <a href="../../../GML_Overview/Arrays.htm">arrays</a> over DS lists as they have similar features, are easier to use and are garbage collected automatically.</p>
<p>When accessing DS list data structures, you should always try to use <b>integer values</b> for the list position, and all non-integer indices will be floored by <span data-keyref="GameMaker Name">GameMaker</span> if you do not. If that is not what you require, then you will need to do the rounding yourself previously before passing the index that you wish to check.</p>
<div data-conref="../../../../assets/snippets/Note_DS_Destroy_When_No_Longer_Needed.hts"> </div>
Expand Down Expand Up @@ -63,7 +63,7 @@ <h3 id="func_ref_json">JSON</h3>
<div style="float:right">Next: <a data-xref="{title}" href="../DS_Maps/DS_Maps.htm">DS Maps</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
DS Lists
Expand Down

0 comments on commit 158ab44

Please sign in to comment.