/* Copyright 2013 Christian Matt
*
* This file is part of PonkOut.
*
* PonkOut is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PonkOut is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with PonkOut. If not, see <http://www.gnu.org/licenses/>.
*/
package ponkOut.logic;
import org.lwjgl.util.vector.Vector2f;
import ponkOut.graphics.GraphicsObjectsManager;
import ponkOut.graphics.ItemGO;
public class Item extends Entity {
/** id determines which item this is. Allowed are values 0...63 */
private int id;
protected ItemGO graphicsObject;
private GraphicsObjectsManager goManager;
private float width;
private float height;
public Item(int id, Vector2f position, Vector2f velocity, float width, float height,
GraphicsObjectsManager goManager) {
this.id = id;
this.width = width;
this.height = height;
this.goManager = goManager;
setPosition(position);
setVelocity(velocity);
EntityManager.getInstance().addItem(this);
graphicsObject = new ItemGO(this, id, width, height, goManager);
}
@Override
public boolean isMovable() {
return true;
}
}