Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions ashley/src/com/badlogic/ashley/core/PooledEngine.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright 2014 See AUTHORS file.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -85,6 +85,20 @@ public void clearPools () {
componentPools.clear();
}

/**
* @return Number of free objects in the entity pool.
*/
public int getEntityPoolFree( ) {
return entityPool.getFree();
}

/**
* @return Number of free objects in the given component type pool.
*/
public <T extends Component> int getComponentPoolFree(Class<T> componentType) {
return componentPools.pools.get(componentType).getFree();
}

@Override
protected void removeEntityInternal (Entity entity) {
super.removeEntityInternal(entity);
Expand Down