[ create a new paste ] login | about

Link: http://codepad.org/e4vsycV1    [ raw code | fork ]

C++, pasted on May 31:
#include <SFML/Graphics.hpp>
#ifndef ITEM_H
#define ITEM_H

class Item
{
	private:
		sf::RenderWindow *Game;
		sf::Sprite ItemSprite;
		sf::Font MyFont;
		sf::Text NumberText;
		unsigned int ItemID;
		unsigned int MaxNumber;
		unsigned int X;		//Die Stelle wo es im Inventar ist
		unsigned int Y;
		int Number;
		bool Move;			//Ob das Item gerade ausgewählt ist und bewegt wird
		bool Life;			//Ob es noch existiert
	public:
		Item(sf::RenderWindow *App, sf::Sprite &Sprite, unsigned int x, unsigned int y, int ItemNumber, 
			unsigned int ItemMaxNumber, unsigned int ID, sf::Font &Font);
		~Item();
		void Update(sf::Clock &Clock, sf::Font &MyFont);
		void Render();
		void SetPosition(float xPos, float yPos, std::stringstream &stream);
		void ChangeNumber(unsigned int Value, bool Change);		//Wenn Change true ist, wird addiert, bei false wird subtrahiert
		void SetNumber(unsigned int x, unsigned int y);			//Damit das Item auf dem ausgewählten Feld gesetzt wird
		void SetNumber(unsigned int NewNumber);				//Oder eine neue Anzahl an Items darauf
		void SetLife(bool NewLife);
		void SetMove(bool NewMove);
		void SetColor(sf::Uint8 Red, sf::Uint8 Green, sf::Uint8 Blue);
		const bool GetMove() const;
		const bool GetLife() const;
		const unsigned int GetItemID() const;
		const unsigned int GetNumber() const;
		const unsigned int GetX() const;
		const unsigned int GetY() const;
		const unsigned int GetMaxNumber() const;
};
#endif


Create a new paste based on this one


Comments: