Permalink
Browse files

Refactoring pathfinder and add multiple properties set/get on tiles

  • Loading branch information...
1 parent ba13aad commit 075edc0c9232b54c51c9d1e7234bba546c5b7d2c @izb committed May 21, 2013
View
@@ -370,6 +370,159 @@ <h4 class="name" id="copyProps"><span class="type-signature"></span>copyProps<sp
</dd>
+
+
+<dt>
+ <h4 class="name" id="setProps"><span class="type-signature"></span>setProps<span class="signature">(s, d)</span><span class="type-signature"> &rarr; {Object}</span></h4>
+
+
+</dt>
+<dd>
+
+
+ <div class="description">
+ Copy properties from one object to another, but only if the destination
+does not have those properties, or if it has undefined values.
+ </div>
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>s</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Object</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">The source object</td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>d</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Object</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">The destination object</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+ <h5>Returns:</h5>
+
+
+<div class="param-desc">
+ The destination object
+</div>
+
+
+
+<dl>
+ <dt class="oneline">
+ Type
+ </dt>
+ <dd class="oneline">
+
+<span class="param-type">Object</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+</dd>
+
</dl>
@@ -2809,7 +2809,7 @@ <h4 class="name" id="getTile"><span class="type-signature"></span>getTile<span c
<dt>
- <h4 class="name" id="getTilePropAtTilePos"><span class="type-signature"></span>getTilePropAtTilePos<span class="signature">(prop, x, y)</span><span class="type-signature"> &rarr; {String}</span></h4>
+ <h4 class="name" id="getTilePropsAtTilePos"><span class="type-signature"></span>getTilePropsAtTilePos<span class="signature">(prop, x, y)</span><span class="type-signature"> &rarr; {String}</span></h4>
</dt>
@@ -2985,7 +2985,7 @@ <h4 class="name" id="getTilePropAtTilePos"><span class="type-signature"></span>g
<dt>
- <h4 class="name" id="getTilePropAtWorldPos"><span class="type-signature"></span>getTilePropAtWorldPos<span class="signature">(prop, x, y)</span><span class="type-signature"> &rarr; {String}</span></h4>
+ <h4 class="name" id="getTilePropsAtWorldPos"><span class="type-signature"></span>getTilePropsAtWorldPos<span class="signature">(prop, x, y)</span><span class="type-signature"> &rarr; {String|Array}</span></h4>
</dt>
@@ -3035,6 +3035,9 @@ <h4 class="name" id="getTilePropAtWorldPos"><span class="type-signature"></span>
<span class="param-type">String</span>
+|
+
+<span class="param-type">Array</span>
@@ -3044,7 +3047,7 @@ <h4 class="name" id="getTilePropAtWorldPos"><span class="type-signature"></span>
- <td class="description last">The property to get</td>
+ <td class="description last">The property or properties to get.</td>
</tr>
@@ -3135,7 +3138,9 @@ <h4 class="name" id="getTilePropAtWorldPos"><span class="type-signature"></span>
<div class="param-desc">
- The property or undefined.
+ The property value, or <code>undefined</code> if not found.
+If the prop parameter was an array, the return value will be an object describing
+all the properties required.
</div>
@@ -3147,6 +3152,9 @@ <h4 class="name" id="getTilePropAtWorldPos"><span class="type-signature"></span>
<dd class="oneline">
<span class="param-type">String</span>
+|
+
+<span class="param-type">Array</span>
</dd>
@@ -3161,6 +3169,159 @@ <h4 class="name" id="getTilePropAtWorldPos"><span class="type-signature"></span>
<dt>
+ <h4 class="name" id="getTilePropsAtWorldPos"><span class="type-signature"></span>getTilePropsAtWorldPos<span class="signature">(props, x, y)</span><span class="type-signature"></span></h4>
+
+
+</dt>
+<dd>
+
+
+ <div class="description">
+ Sets multiple properties on the topmost tile at a given tile position.
+ </div>
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>props</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Object</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">An object containing all the properties
+to copy into the tile's properties.</td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>x</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Number</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">The x tile column position</td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>y</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">Number</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">The y tile row position</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+<dt>
<h4 class="name" id="getTileWorldPos"><span class="type-signature"></span>getTileWorldPos<span class="signature">(c, r)</span><span class="type-signature"> &rarr; {Object}</span></h4>
Oops, something went wrong.

0 comments on commit 075edc0

Please sign in to comment.