git repos / blockattack-game

blame: source/code/sago/SagoSpriteHolder.hpp

normal view · raw

82da8a1c sago007 2015-12-19 18:00 1
/*
82da8a1c sago007 2015-12-19 18:00 2
  Copyright (c) 2015 Poul Sander
82da8a1c sago007 2015-12-19 18:00 3
82da8a1c sago007 2015-12-19 18:00 4
  Permission is hereby granted, free of charge, to any person
82da8a1c sago007 2015-12-19 18:00 5
  obtaining a copy of this software and associated documentation files
82da8a1c sago007 2015-12-19 18:00 6
  (the "Software"), to deal in the Software without restriction,
82da8a1c sago007 2015-12-19 18:00 7
  including without limitation the rights to use, copy, modify, merge,
82da8a1c sago007 2015-12-19 18:00 8
  publish, distribute, sublicense, and/or sell copies of the Software,
82da8a1c sago007 2015-12-19 18:00 9
  and to permit persons to whom the Software is furnished to do so,
82da8a1c sago007 2015-12-19 18:00 10
  subject to the following conditions:
82da8a1c sago007 2015-12-19 18:00 11
82da8a1c sago007 2015-12-19 18:00 12
  The above copyright notice and this permission notice shall be
82da8a1c sago007 2015-12-19 18:00 13
  included in all copies or substantial portions of the Software.
82da8a1c sago007 2015-12-19 18:00 14
82da8a1c sago007 2015-12-19 18:00 15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
82da8a1c sago007 2015-12-19 18:00 16
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
82da8a1c sago007 2015-12-19 18:00 17
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
82da8a1c sago007 2015-12-19 18:00 18
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
82da8a1c sago007 2015-12-19 18:00 19
  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
82da8a1c sago007 2015-12-19 18:00 20
  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
82da8a1c sago007 2015-12-19 18:00 21
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
82da8a1c sago007 2015-12-19 18:00 22
  SOFTWARE.
82da8a1c sago007 2015-12-19 18:00 23
*/
82da8a1c sago007 2015-12-19 18:00 24
82da8a1c sago007 2015-12-19 18:00 25
#ifndef SAGOSPRITEHOLDER_HPP
82da8a1c sago007 2015-12-19 18:00 26
#define	SAGOSPRITEHOLDER_HPP
82da8a1c sago007 2015-12-19 18:00 27
82da8a1c sago007 2015-12-19 18:00 28
#include "SagoDataHolder.hpp"
82da8a1c sago007 2015-12-19 18:00 29
#include "SagoSprite.hpp"
82da8a1c sago007 2015-12-19 18:00 30
82da8a1c sago007 2015-12-19 18:00 31
namespace sago {
82da8a1c sago007 2015-12-19 18:00 32
82da8a1c sago007 2015-12-19 18:00 33
class SagoSpriteHolder {
82da8a1c sago007 2015-12-19 18:00 34
public:
82da8a1c sago007 2015-12-19 18:00 35
	SagoSpriteHolder(const SagoDataHolder &texHolder);
82da8a1c sago007 2015-12-19 18:00 36
	virtual ~SagoSpriteHolder();
82da8a1c sago007 2015-12-19 18:00 37
	void ReadSprites();
82da8a1c sago007 2015-12-19 18:00 38
	const sago::SagoSprite& GetSprite(const std::string &spritename) const;
82da8a1c sago007 2015-12-19 18:00 39
	const SagoDataHolder& GetDataHolder() const;
82da8a1c sago007 2015-12-19 18:00 40
private:
82da8a1c sago007 2015-12-19 18:00 41
	SagoSpriteHolder(const SagoSpriteHolder& base) = delete;
82da8a1c sago007 2015-12-19 18:00 42
    SagoSpriteHolder& operator=(const SagoSpriteHolder& base) = delete;
82da8a1c sago007 2015-12-19 18:00 43
	void ReadSpriteFile(const std::string &filename);
82da8a1c sago007 2015-12-19 18:00 44
	struct SagoSpriteHolderData;
82da8a1c sago007 2015-12-19 18:00 45
	SagoSpriteHolderData *data;
82da8a1c sago007 2015-12-19 18:00 46
};
82da8a1c sago007 2015-12-19 18:00 47
82da8a1c sago007 2015-12-19 18:00 48
}
82da8a1c sago007 2015-12-19 18:00 49
82da8a1c sago007 2015-12-19 18:00 50
#endif	/* SAGOSPRITEHOLDER_HPP */
82da8a1c sago007 2015-12-19 18:00 51
1970-01-01 00:00 52