2013-12-27 23:59:59 +01:00
|
|
|
package appeng.me;
|
|
|
|
|
|
|
|
import appeng.api.networking.IGrid;
|
|
|
|
import appeng.api.networking.IGridCache;
|
|
|
|
import appeng.api.networking.IGridHost;
|
|
|
|
import appeng.api.networking.IGridNode;
|
|
|
|
import appeng.api.networking.IGridStorage;
|
|
|
|
import appeng.me.cache.TickManagerCache;
|
|
|
|
|
|
|
|
public class GridCacheWrapper implements IGridCache
|
|
|
|
{
|
|
|
|
|
|
|
|
final public boolean isTickHandler;
|
2014-01-20 17:41:37 +01:00
|
|
|
final IGridCache myCache;
|
|
|
|
final String name;
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2014-01-20 17:41:37 +01:00
|
|
|
public GridCacheWrapper(final IGridCache gc) {
|
2013-12-27 23:59:59 +01:00
|
|
|
myCache = gc;
|
2014-01-20 17:41:37 +01:00
|
|
|
name = myCache.getClass().getName();
|
2013-12-27 23:59:59 +01:00
|
|
|
isTickHandler = myCache instanceof TickManagerCache;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-01-20 17:41:37 +01:00
|
|
|
public void onUpdateTick(final IGrid grid)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
myCache.onUpdateTick( grid );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-01-20 17:41:37 +01:00
|
|
|
public void removeNode(final IGrid grid, final IGridNode gridNode, final IGridHost machine)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
myCache.removeNode( grid, gridNode, machine );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-01-20 17:41:37 +01:00
|
|
|
public void addNode(final IGrid grid, final IGridNode gridNode, final IGridHost machine)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
myCache.addNode( grid, gridNode, machine );
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getName()
|
|
|
|
{
|
2014-01-20 17:41:37 +01:00
|
|
|
return name;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-01-20 17:41:37 +01:00
|
|
|
public void onSplit(final IGridStorage storageB)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
myCache.onSplit( storageB );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-01-20 17:41:37 +01:00
|
|
|
public void onJoin(final IGridStorage storageB)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
myCache.onJoin( storageB );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-01-20 17:41:37 +01:00
|
|
|
public void populateGridStorage(final IGridStorage storage)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
myCache.populateGridStorage( storage );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|