#pragma once #include using namespace Framework; class ColorMode { private: int ref; public: ColorMode(); virtual Bild *colorImage( Bild *zImg, int color ); ColorMode *getThis(); ColorMode *release(); }; class AlphaColorMode : public ColorMode { private: unsigned char alpha; public: AlphaColorMode( unsigned char alpha ); Bild *colorImage( Bild *zImg, int color ) override; }; class MaskColorMode : public ColorMode { private: int colorToReplace; public: MaskColorMode( int colorToReplace ); Bild *colorImage( Bild *zImg, int color ) override; }; enum ResourceIds { R_BARIERE, R_BASE, R_PFEIL_GESCHOSS, R_PFEIL, R_LEBEN, R_SCHILD, R_SCHUH, R_GEIST, R_ROLLE, R_ROLLE_OBEN, R_ROLLE_LINKS, R_ROLLE_RECHTS, R_ROLLE_UNTEN, R_STURM, R_STURM_OBEN, R_STURM_LINKS, R_STURM_RECHTS, R_STURM_UNTEN, R_DRACHENAUGE, R_DRACHENAUGE_GESCHOSS, R_FEUERBALL, R_FEUERBALL_GESCHOSS, R_FEUERBALL_TREFFER, R_ENTERHAKEN_SEIL, R_ENTERHAKEN_SPITZE, R_ENTERHAKEN_ITEM, R_MINE, R_MINE_GESCHOSS, R_RWEISHEIT, R_RBOSHEIT, R_RLEBEN, R_RTEMPO, R_RSTRENGTH, R_SCHALTER, R_SCHIENE, R_SPIELER_STIRBT, R_SPIELER, R_SPIELER_RECHTS, R_SPIELER_LINKS, R_TUNNEL, R_UMLENKUNG }; class ResourceRegistry; class Resource { private: ResourceIds id; int color; int ref; RCArray< Bild > images; public: Resource( ResourceIds id, int color ); virtual Resource *createColoredResource( int color, ColorMode *mode ) const; Iterator< Bild * > getImages() const; ResourceIds getId() const; int getColor() const; Resource *getThis(); Resource *release(); friend ResourceRegistry; }; class ResourceRegistry { private: RCArray< Resource > resources; Text spielPfad; Text mapPfad; int ref; public: ResourceRegistry( Text spielPfad, Text mapPfad ); Resource *getResource( ResourceIds id, int color, ColorMode *mode = 0, Text path = "" ); Resource *zResource( ResourceIds id, int color, ColorMode *mode = 0, Text path = "" ); ResourceRegistry *getThis(); ResourceRegistry *release(); };