Skip to content

Commit

Permalink
refactor: add deprecation notice to method
Browse files Browse the repository at this point in the history
  • Loading branch information
andretchen0 committed Jul 17, 2023
1 parent 4cdd066 commit b19110b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utility/hex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,19 @@ export class Hex {
return drops.length > 0 ? drops[0] : undefined;
}

/**
* @deprecated Use getPointFacade().getCreaturesAt({x, y});
*/
get creature(): Creature | undefined {
const creatures = getPointFacade().getCreaturesAt(this.x, this.y);
return creatures.length ? creatures[0] : undefined;
}

/**
* @deprecated There's no longer a need to set hex.creature. Simply update the creature.
*/
set creature(creature: Creature) {
// NOTE: solely for compatability.
// this.creature used to be settable, but now it's derived.
}

onSelectFn(arg0: this) {
Expand Down

0 comments on commit b19110b

Please sign in to comment.