#pragma once
#include "cocos2d.h"
#include "PRect.h"

#define ITEM_TYPE_HP		1
#define ITEM_TYPE_AP		2
#define ITEM_TYPE_THROW		3
#define ITEM_TYPE_BULLET	4


class Item
{
public:
	bool _used;
	cocos2d::Sprite* _sprite;
	cocos2d::SpriteBatchNode* _batch; 
	unsigned _team;
	unsigned _type;
	unsigned _id;
	PRect _rect;

	Item(void);
	Item(unsigned id,
		unsigned type,
		unsigned team,
		cocos2d::Vec2 position,
		cocos2d::Node* parent,
		cocos2d::Vec2 direction = cocos2d::Vec2(0,0),
		float speed = 0);
	~Item(void);

	void setUsed();
	bool isUsed();
	PRect* getRect();
	int getType();
	int getTeam();
	virtual void UpdateRect();
	void UpdateZOrder(unsigned z);
};

bool compareItemByZOrder(Item* u1,Item* u2);

