Skip to content

Commit

Permalink
rename collect to tryCollect to better represent its return values
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamms committed Mar 2, 2018
1 parent 6812165 commit 92d2cf3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/src/maze/api.js
Expand Up @@ -362,7 +362,7 @@ exports.atSprout = API_FUNCTION(function (id) {
exports.collect = API_FUNCTION(function (id) {
var col = Maze.controller.pegmanX;
var row = Maze.controller.pegmanY;
if (Maze.controller.subtype.collect(row, col)) {
if (Maze.controller.subtype.tryCollect(row, col)) {
Maze.executionInfo.queueAction('pickup', id);
}
});
2 changes: 1 addition & 1 deletion apps/src/maze/collector.js
Expand Up @@ -82,7 +82,7 @@ export default class Collector extends Subtype {
*
* @return {boolean} whether or not this attempt was successful
*/
collect(row, col) {
tryCollect(row, col) {
const currVal = this.maze_.map.getValue(row, col);

if (currVal === undefined || currVal < 1) {
Expand Down

0 comments on commit 92d2cf3

Please sign in to comment.