Go to the documentation of this file.
15 #include "../ResourcesManager.h"
16 #include "../CREPixmap.h"
40 myRaw.replace(0, 4,
"Object");
42 if (
more != std::string::npos) {
83 while (
index > 0 && part) {
100 while (part !=
child && part) {
130 if (!
arch->clone.randomitems || !fleshFace)
133 std::vector<const archetype *> sources;
136 sources.push_back(candidate);
139 for (
auto source : sources) {
148 auto face =
dynamic_cast<const FaceWrapper *
>(asset);
149 if (face !=
nullptr) {
156 if (strncmp(
myWrappedItem->
name, face->wrappedItem()->name, len) == 0 && face->wrappedItem()->name[len] ==
'_') {
186 hint =
"death animation";
190 auto sound =
dynamic_cast<const SoundFile *
>(asset);
195 bool uses = std::any_of(sound->events().cbegin(), sound->events().cend(), [
this] (
const std::string &
event) {
196 return event == myWrappedItem->name || event == myWrappedItem->clone.name;
212 if (
item->next_yes && ci(
item->next_yes)) {
215 if (
item->next_no && ci(
item->next_no)) {
228 return QString::fromStdString(
myRaw);
238 loader.
load(br, origin);
static const char * Archetype
archetype * myWrappedItem
void addMime(QMimeData *data, const QString &mime, const QString &name)
T * first(std::function< bool(const T *)> op)
arch
DIALOGCHECK MINARGS 1 MAXARGS 1
void setRaw(const QString &raw)
StringBuffer * stringbuffer_new(void)
ArchetypeWrapper * wrap(archetype *arch, AssetWrapper *parent)
void setSpecificItem(const object *item, bool notify)
static bool treasureContains(const treasure *t, const archetype *arch)
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
void bufferreader_destroy(BufferReader *br)
virtual AssetWrapper * child(int child) override
bool appearsOnTreasureList() const
const char * object_get_value(const object *op, const char *const key)
AssetsManager * getManager()
T * find(const Key &name)
std::string originOf(const archetype *arch) const
char * stringbuffer_finish(StringBuffer *sb)
ArchetypeWrapper(AssetWrapper *parent, archetype *arch, ResourcesManager *resourcesManager)
virtual void wasModified(AssetWrapper *asset, ChangeType type, int extra) override
void object_dump(const object *op, StringBuffer *sb)
virtual void load(BufferReader *reader, const std::string &filename) override
std::vector< ArtifactWrapper * > myArtifacts
ResourcesManager * myResources
virtual void fillMenu(QMenu *)
void each(std::function< void(T *)> op)
virtual int childrenCount() const override
archetype * wrappedItem() const
const Animations * animation
struct archetype * other_arch
Archetypes * archetypes()
static bool isValidArchFlesh(const archetype *arch, const Face *fleshFace)
void archetypeModified(archetype *arch)
virtual int childIndex(AssetWrapper *child) override
BufferReader * bufferreader_init_from_memory(BufferReader *br, const char *data, size_t length)
const typedef char * sstring
virtual int childIndex(AssetWrapper *child) override
virtual void wasModified(AssetWrapper *asset, ChangeType type, int extra)
struct treasurelist * randomitems
void markModified(ChangeType change, int extra=0)
event
DIALOGCHECK MINARGS 1 MAXARGS 2
virtual void fillMenu(QMenu *menu) override
virtual AssetWrapper * child(int index) override
virtual void drag(QMimeData *) const override