generalized conditions for saving entities with chunks

This commit is contained in:
Dylan K. Taylor
2017-11-19 18:06:38 +00:00
parent 19dc22d6b3
commit a9df383346
4 changed files with 16 additions and 15 deletions

View File

@ -667,6 +667,13 @@ class Chunk{
return $this->entities;
}
/**
* @return Entity[]
*/
public function getSavableEntities() : array{
return array_filter($this->entities, function(Entity $entity) : bool{ return $entity->canSaveWithChunk() and !$entity->isClosed(); });
}
/**
* @return Tile[]
*/