-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path541.html
34 lines (34 loc) · 4.92 KB
/
541.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html><head><title>DetectCollision.java</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="sourcestyles.css" />
</head><body link="blue" vlink="blue">
<h3>File: /Users/shatabdi/Education/GitHub/se450_project/src/model/others/DetectCollision.java</h3>
<SCRIPT>
defaultStatus = "File: /Users/shatabdi/Education/GitHub/se450_project/src/model/others/DetectCollision.java";
top.document.title = "DetectCollision.java";
</SCRIPT>
<pre><span class="default"></span><a name="1"><font size=-1>1 </font></a><span class="default"></span><span class="keyword">package </span><span class="default">model.<a href="dictionary_M.html#16">others</a>;</span>
<a name="2"><font size=-1>2 </font></a><span class="default"></span>
<a name="3"><font size=-1>3 </font></a><span class="default"></span><span class="keyword">import </span><span class="default">java.<a href="dictionary_J.html#41">awt</a>.*;</span>
<a name="4"><font size=-1>4 </font></a><span class="default"></span>
<a name="5"><font size=-1>5 </font></a><span class="default"></span><span class="keyword">public class <a href="dictionary_M.html#542">DetectCollision</a> </span><span class="default">{</span>
<a name="6"><font size=-1>6 </font></a><span class="default"></span>
<a name="7"><font size=-1>7 </font></a><span class="default"> </span><span class="keyword">public static boolean <a href="dictionary_M.html#543">detect</a></span><span class="default">(<a href="dictionary_S.html#28">Shape</a> <a href="dictionary_M.html#549">shape</a>, <a href="dictionary_S.html#28">Shape</a> <a href="dictionary_M.html#548">otherShape</a>) {</span>
<a name="8"><font size=-1>8 </font></a><span class="default"> <a href="dictionary_R.html#551">Rectangle</a> <a href="dictionary_M.html#544">boundRect1</a> = <a href="dictionary_M.html#549">shape</a>.<a href="dictionary_G.html#106">getBounds</a>();</span>
<a name="9"><font size=-1>9 </font></a><span class="default"> <a href="dictionary_R.html#551">Rectangle</a> <a href="dictionary_M.html#545">boundRect2</a> = <a href="dictionary_M.html#548">otherShape</a>.<a href="dictionary_G.html#106">getBounds</a>();</span>
<a name="10"><font size=-1>10 </font></a><span class="default"></span>
<a name="11"><font size=-1>11 </font></a><span class="default"> </span><span class="keyword">boolean <a href="dictionary_M.html#547">isCollision</a> </span><span class="default">= </span><span class="keyword">false</span><span class="default">;</span>
<a name="12"><font size=-1>12 </font></a><span class="default"></span>
<a name="13"><font size=-1>13 </font></a><span class="default"> </span><span class="keyword">if </span><span class="default">(<a href="dictionary_M.html#544">boundRect1</a>.<a href="dictionary_X.html#303">x</a> < <a href="dictionary_M.html#545">boundRect2</a>.<a href="dictionary_X.html#303">x</a> + <a href="dictionary_M.html#545">boundRect2</a>.<a href="dictionary_W.html#550">width</a> &&</span>
<a name="14"><font size=-1>14 </font></a><span class="default"> <a href="dictionary_M.html#544">boundRect1</a>.<a href="dictionary_X.html#303">x</a> + <a href="dictionary_M.html#544">boundRect1</a>.<a href="dictionary_W.html#550">width</a> > <a href="dictionary_M.html#545">boundRect2</a>.<a href="dictionary_X.html#303">x</a> &&</span>
<a name="15"><font size=-1>15 </font></a><span class="default"> <a href="dictionary_M.html#544">boundRect1</a>.<a href="dictionary_Y.html#304">y</a> < <a href="dictionary_M.html#545">boundRect2</a>.<a href="dictionary_Y.html#304">y</a> + <a href="dictionary_M.html#545">boundRect2</a>.<a href="dictionary_H.html#546">height</a> &&</span>
<a name="16"><font size=-1>16 </font></a><span class="default"> <a href="dictionary_M.html#544">boundRect1</a>.<a href="dictionary_Y.html#304">y</a> + <a href="dictionary_M.html#544">boundRect1</a>.<a href="dictionary_H.html#546">height</a> > <a href="dictionary_M.html#545">boundRect2</a>.<a href="dictionary_Y.html#304">y</a>) {</span>
<a name="17"><font size=-1>17 </font></a><span class="default"></span>
<a name="18"><font size=-1>18 </font></a><span class="default"> <a href="dictionary_M.html#547">isCollision</a> = </span><span class="keyword">true</span><span class="default">;</span>
<a name="19"><font size=-1>19 </font></a><span class="default"> }</span>
<a name="20"><font size=-1>20 </font></a><span class="default"></span>
<a name="21"><font size=-1>21 </font></a><span class="default"> </span><span class="keyword">return <a href="dictionary_M.html#547">isCollision</a></span><span class="default">;</span>
<a name="22"><font size=-1>22 </font></a><span class="default"> }</span>
<a name="23"><font size=-1>23 </font></a><span class="default">}</span>
<a name="24"><font size=-1>24 </font></a><span class="default"></span>
</pre></body></html>