Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
Tetris/doc/html/class_grid.html
2022-06-08 09:14:30 +02:00

351 lines
17 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Tetris: Grid Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">Tetris
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('class_grid.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#properties">Properties</a> &#124;
<a href="class_grid-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">Grid Class Reference</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:abc698d651a01f136ca864e585a2cf2ac"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_grid.html#abc698d651a01f136ca864e585a2cf2ac">Grid</a> (Color[,] grid)</td></tr>
<tr class="memdesc:abc698d651a01f136ca864e585a2cf2ac"><td class="mdescLeft">&#160;</td><td class="mdescRight"><blockquote class="doxtable">
<p >&zwj;Create a <a class="el" href="class_grid.html">Grid</a> object with a given grid of colors </p>
</blockquote>
<a href="class_grid.html#abc698d651a01f136ca864e585a2cf2ac">More...</a><br /></td></tr>
<tr class="separator:abc698d651a01f136ca864e585a2cf2ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16f5006b1f0022c470743b7faf9a34d6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_grid.html#a16f5006b1f0022c470743b7faf9a34d6">CanGo</a> (<a class="el" href="class_tetrominoe.html">Tetrominoe</a> tetrominoe, Point point)</td></tr>
<tr class="memdesc:a16f5006b1f0022c470743b7faf9a34d6"><td class="mdescLeft">&#160;</td><td class="mdescRight"><blockquote class="doxtable">
<p >&zwj;If the tetrominoe is within the grid and doesn't overlap with any other tetrominoe, then return true </p>
</blockquote>
<a href="class_grid.html#a16f5006b1f0022c470743b7faf9a34d6">More...</a><br /></td></tr>
<tr class="separator:a16f5006b1f0022c470743b7faf9a34d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc96dc816179b64d601e2b694816a672"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_grid.html#acc96dc816179b64d601e2b694816a672">LineFull</a> ()</td></tr>
<tr class="memdesc:acc96dc816179b64d601e2b694816a672"><td class="mdescLeft">&#160;</td><td class="mdescRight"><blockquote class="doxtable">
<p >&zwj;If the line is full, return the line number, otherwise return -1 </p>
</blockquote>
<a href="class_grid.html#acc96dc816179b64d601e2b694816a672">More...</a><br /></td></tr>
<tr class="separator:acc96dc816179b64d601e2b694816a672"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa503fc3e64dae3b3ad599fe5da9d6357"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_grid.html#aa503fc3e64dae3b3ad599fe5da9d6357">ClearLine</a> (int line)</td></tr>
<tr class="memdesc:aa503fc3e64dae3b3ad599fe5da9d6357"><td class="mdescLeft">&#160;</td><td class="mdescRight"><blockquote class="doxtable">
<p >&zwj;For each column, move all the blocks down one row, and then clear the top row </p>
</blockquote>
<a href="class_grid.html#aa503fc3e64dae3b3ad599fe5da9d6357">More...</a><br /></td></tr>
<tr class="separator:aa503fc3e64dae3b3ad599fe5da9d6357"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0486b9067add18fe4714a05d97613639"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_grid.html#a0486b9067add18fe4714a05d97613639">PrintTetrominoe</a> (<a class="el" href="class_tetrominoe.html">Tetrominoe</a> t)</td></tr>
<tr class="memdesc:a0486b9067add18fe4714a05d97613639"><td class="mdescLeft">&#160;</td><td class="mdescRight">For each point in the shape, add the shape's coordinates to the point, and if the point is true, set the grid's color to the shape's color. <a href="class_grid.html#a0486b9067add18fe4714a05d97613639">More...</a><br /></td></tr>
<tr class="separator:a0486b9067add18fe4714a05d97613639"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab87c3023d0eec5ae4bfb10d1b03b0456"><td class="memItemLeft" align="right" valign="top">override string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_grid.html#ab87c3023d0eec5ae4bfb10d1b03b0456">ToString</a> ()</td></tr>
<tr class="memdesc:ab87c3023d0eec5ae4bfb10d1b03b0456"><td class="mdescLeft">&#160;</td><td class="mdescRight">Covert the gid to a color string <a href="class_grid.html#ab87c3023d0eec5ae4bfb10d1b03b0456">More...</a><br /></td></tr>
<tr class="separator:ab87c3023d0eec5ae4bfb10d1b03b0456"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0c0ee41cfe32f7378e6bf83002e76b2"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_grid.html#aa0c0ee41cfe32f7378e6bf83002e76b2">ToString</a> (<a class="el" href="class_tetrominoe.html">Tetrominoe</a> t)</td></tr>
<tr class="memdesc:aa0c0ee41cfe32f7378e6bf83002e76b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Covert the gid to a color string with the current tetrominoe <a href="class_grid.html#aa0c0ee41cfe32f7378e6bf83002e76b2">More...</a><br /></td></tr>
<tr class="separator:aa0c0ee41cfe32f7378e6bf83002e76b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="properties" name="properties"></a>
Properties</h2></td></tr>
<tr class="memitem:ad26d84a765213c0333605154a8aafe81"><td class="memItemLeft" align="right" valign="top"><a id="ad26d84a765213c0333605154a8aafe81" name="ad26d84a765213c0333605154a8aafe81"></a>
Color[,]&#160;</td><td class="memItemRight" valign="bottom"><b>CGrid</b><code> [get]</code></td></tr>
<tr class="separator:ad26d84a765213c0333605154a8aafe81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa13870e4fe43a2995e88158302c01cf"><td class="memItemLeft" align="right" valign="top"><a id="aaa13870e4fe43a2995e88158302c01cf" name="aaa13870e4fe43a2995e88158302c01cf"></a>
Point&#160;</td><td class="memItemRight" valign="bottom"><b>MinGrid</b><code> [get]</code></td></tr>
<tr class="separator:aaa13870e4fe43a2995e88158302c01cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10e2c475db2adf4cc07917ea4fd25d95"><td class="memItemLeft" align="right" valign="top"><a id="a10e2c475db2adf4cc07917ea4fd25d95" name="a10e2c475db2adf4cc07917ea4fd25d95"></a>
Point&#160;</td><td class="memItemRight" valign="bottom"><b>MaxGrid</b><code> [get]</code></td></tr>
<tr class="separator:a10e2c475db2adf4cc07917ea4fd25d95"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="abc698d651a01f136ca864e585a2cf2ac" name="abc698d651a01f136ca864e585a2cf2ac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc698d651a01f136ca864e585a2cf2ac">&#9670;&nbsp;</a></span>Grid()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Grid.Grid </td>
<td>(</td>
<td class="paramtype">Color&#160;</td>
<td class="paramname"><em>grid</em>[,]</td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p><blockquote class="doxtable">
<p >&zwj;Create a <a class="el" href="class_grid.html">Grid</a> object with a given grid of colors </p>
</blockquote>
</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">grid</td><td>The color grid.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a16f5006b1f0022c470743b7faf9a34d6" name="a16f5006b1f0022c470743b7faf9a34d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a16f5006b1f0022c470743b7faf9a34d6">&#9670;&nbsp;</a></span>CanGo()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Grid.CanGo </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_tetrominoe.html">Tetrominoe</a>&#160;</td>
<td class="paramname"><em>tetrominoe</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Point&#160;</td>
<td class="paramname"><em>point</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p><blockquote class="doxtable">
<p >&zwj;If the tetrominoe is within the grid and doesn't overlap with any other tetrominoe, then return true </p>
</blockquote>
</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname"><a class="el" href="class_tetrominoe.html">Tetrominoe</a></td><td>The tetrominoe to check if it can go to the point.</td></tr>
<tr><td class="paramname">Point</td><td>The point where the tetrominoe will be placed.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A boolean value. </dd></dl>
</div>
</div>
<a id="aa503fc3e64dae3b3ad599fe5da9d6357" name="aa503fc3e64dae3b3ad599fe5da9d6357"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa503fc3e64dae3b3ad599fe5da9d6357">&#9670;&nbsp;</a></span>ClearLine()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Grid.ClearLine </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>line</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p><blockquote class="doxtable">
<p >&zwj;For each column, move all the blocks down one row, and then clear the top row </p>
</blockquote>
</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">line</td><td>The line to clear</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="acc96dc816179b64d601e2b694816a672" name="acc96dc816179b64d601e2b694816a672"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acc96dc816179b64d601e2b694816a672">&#9670;&nbsp;</a></span>LineFull()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int Grid.LineFull </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p><blockquote class="doxtable">
<p >&zwj;If the line is full, return the line number, otherwise return -1 </p>
</blockquote>
</p>
<dl class="section return"><dt>Returns</dt><dd>The y value of the first full line. </dd></dl>
</div>
</div>
<a id="a0486b9067add18fe4714a05d97613639" name="a0486b9067add18fe4714a05d97613639"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0486b9067add18fe4714a05d97613639">&#9670;&nbsp;</a></span>PrintTetrominoe()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Grid.PrintTetrominoe </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_tetrominoe.html">Tetrominoe</a>&#160;</td>
<td class="paramname"><em>t</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>For each point in the shape, add the shape's coordinates to the point, and if the point is true, set the grid's color to the shape's color. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname"><a class="el" href="class_tetrominoe.html">Tetrominoe</a></td><td>The <a class="el" href="class_tetrominoe.html">Tetrominoe</a> to be printed.</td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ab87c3023d0eec5ae4bfb10d1b03b0456" name="ab87c3023d0eec5ae4bfb10d1b03b0456"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab87c3023d0eec5ae4bfb10d1b03b0456">&#9670;&nbsp;</a></span>ToString() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">override string Grid.ToString </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Covert the gid to a color string </p>
<dl class="section return"><dt>Returns</dt><dd>A string representation of the grid. </dd></dl>
</div>
</div>
<a id="aa0c0ee41cfe32f7378e6bf83002e76b2" name="aa0c0ee41cfe32f7378e6bf83002e76b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0c0ee41cfe32f7378e6bf83002e76b2">&#9670;&nbsp;</a></span>ToString() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">string Grid.ToString </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_tetrominoe.html">Tetrominoe</a>&#160;</td>
<td class="paramname"><em>t</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Covert the gid to a color string with the current tetrominoe </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname"><a class="el" href="class_tetrominoe.html">Tetrominoe</a></td><td>The tetrominoe to print.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A string representation of the grid. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>Tetris/Models/Grid.cs</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="class_grid.html">Grid</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4 </li>
</ul>
</div>
</body>
</html>