Example usage for com.badlogic.gdx.utils Pool Pool

List of usage examples for com.badlogic.gdx.utils Pool Pool

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils Pool Pool.

Prototype

public Pool() 

Source Link

Document

Creates a pool with an initial capacity of 16 and no maximum.

Usage

From source file:com.mangecailloux.pebble.entity.manager.EntityGroupManager.java

License:Apache License

public EntityGroupManager() {
    super();//  www.j  av a2  s. c  om

    groups = new ObjectMap<EntityGroup, Array<Entity>>(4);
    groupsByEntity = new ObjectMap<Entity, Array<EntityGroup>>(4);

    entityGroupArrayPool = new Pool<Array<EntityGroup>>() {
        @Override
        protected Array<EntityGroup> newObject() {
            return new Array<EntityGroup>(false, 4);
        }

    };
}

From source file:com.mangecailloux.pebble.entity.manager.EntityTagManager.java

License:Apache License

public EntityTagManager() {
    super();//from ww  w  .ja v  a  2 s .com

    entityByTags = new ObjectMap<String, Entity>(8);
    tagsByEntity = new ObjectMap<Entity, Array<String>>(8);

    stringArrayPool = new Pool<Array<String>>() {
        @Override
        protected Array<String> newObject() {
            return new Array<String>(false, 4);
        }
    };

}

From source file:com.octa.topdown.armory.Weapon.java

License:Open Source License

public Weapon(int animationId, int fireRate, int damage, int range, int bullSpeed, int knockback,
        boolean isMeele) {
    this.fireRate = fireRate;
    this.damage = damage;
    this.range = range;
    this.bullSpeed = bullSpeed;
    this.animationId = animationId;
    this.isMeele = isMeele;
    this.lastShoot = 0;
    this.isHitting = false;
    this.state = 0;
    this.knockBack = knockback;

    bullets = new ArrayList<Bullet>();
    bulletPool = new Pool<Bullet>() {
        @Override/*from w  w w  .j a  va 2 s.c om*/
        public Bullet newObject() {
            return new Bullet();
        }
    };
}

From source file:com.octa.topdown.entities.ZombieManager.java

License:Open Source License

public ZombieManager(TileMap map) {
    zombies = new ArrayList<Zombie>();
    zPool = new Pool<Zombie>() {
        @Override//from ww w .ja v a 2s  . c  o m
        public Zombie newObject() {
            return new Zombie();
        }
    };

    lastSpawned = 0;
    delay = 1500;
    this.map = map;
}

From source file:com.octa.topdown.items.ItemSpawner.java

License:Open Source License

public ItemSpawner() {
    items = new ArrayList<Box>();

    bPool = new Pool<Box>() {
        @Override//ww w .  j a v  a2s .c o  m
        public Box newObject() {
            return new Box();
        }
    };

    lastSpawned = 0;
    delay = 1500;
    decider = new Random();
}

From source file:com.quadbits.gdxhelper.LWPGameModule.java

License:Apache License

@Provides
@PerGame//from   w  w w  . j a  va 2  s . c o  m
Pool<AnimatedSpriteActor> provideAnimatedSpriteActorPool(final Provider<AnimatedSpriteActor> provider) {
    return new Pool<AnimatedSpriteActor>() {
        @Override
        protected AnimatedSpriteActor newObject() {
            AnimatedSpriteActor object = provider.get();
            object.setPool(this);
            return object;
        }
    };
}

From source file:com.quadbits.gdxhelper.LWPGameModule.java

License:Apache License

@Provides
@PerGame/*from   w  w  w.java 2s .c om*/
Pool<AnimatedSpriteGrid> provideAnimatedSpriteGridPool(final Provider<AnimatedSpriteGrid> provider) {
    return new Pool<AnimatedSpriteGrid>() {
        @Override
        protected AnimatedSpriteGrid newObject() {
            AnimatedSpriteGrid object = provider.get();
            object.setPool(this);
            return object;
        }
    };
}

From source file:com.quadbits.gdxhelper.LWPGameModule.java

License:Apache License

@Provides
@PerGame/*  w  w  w  . jav  a  2s. c o  m*/
Pool<AnimatedSpriteGrid.AnimationSequence> provideAnimationSequencePool(
        final Provider<AnimatedSpriteGrid.AnimationSequence> provider) {
    return new Pool<AnimatedSpriteGrid.AnimationSequence>() {
        @Override
        protected AnimatedSpriteGrid.AnimationSequence newObject() {
            AnimatedSpriteGrid.AnimationSequence object = provider.get();
            object.setPool(this);
            return object;
        }
    };
}

From source file:com.quadbits.gdxhelper.LWPGameModule.java

License:Apache License

@Provides
@PerGame//from  w  ww. j av a 2s. c o m
Pool<BackgroundActor> provideBackgroundActorPool(final Provider<BackgroundActor> provider) {
    return new Pool<BackgroundActor>() {
        @Override
        protected BackgroundActor newObject() {
            BackgroundActor object = provider.get();
            object.setPool(this);
            return object;
        }
    };
}

From source file:com.quadbits.gdxhelper.LWPGameModule.java

License:Apache License

@Provides
@PerGame/*from   ww w  . ja va2 s  .c  o m*/
Pool<CloudsActor.Cloud> provideCloudPool(final Provider<CloudsActor.Cloud> provider) {
    return new Pool<CloudsActor.Cloud>() {
        @Override
        protected CloudsActor.Cloud newObject() {
            CloudsActor.Cloud object = provider.get();
            object.setPool(this);
            return object;
        }
    };
}