refactor: better interface
This commit is contained in:
parent
4da1b827d5
commit
fd24ca6c7c
|
@ -29,12 +29,8 @@ export class Listed extends Trait {
|
|||
methods() {
|
||||
return {
|
||||
|
||||
nearbyEntities: (size) => {
|
||||
const location = this._listLocator ?
|
||||
this._listLocator()
|
||||
:
|
||||
this.entity.position;
|
||||
const position = Vector.add(location, Vector.scale(size, -0.5));
|
||||
nearbyEntities: (size, position = this.entity.position) => {
|
||||
position = Vector.add(position, Vector.scale(size, -0.5));
|
||||
return this._list.within(Rectangle.compose(position, size));
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user