Crossfire Server, Trunk
AttackMessagesWrapper.cpp
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2022 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #include "AttackMessagesWrapper.h"
14 #include "AttackMessagePanel.h"
15 
16 static std::vector<const char *> types({
17  "arrow",
18  "drain",
19  "electricity",
20  "cold",
21  "fire",
22  "basic attack",
23  "karate",
24  "claw",
25  "punch",
26  "slash",
27  "pierce",
28  "cleave",
29  "slice",
30  "stab",
31  "whip",
32  "crush",
33  "blud",
34  "door",
35  "poison and disease",
36  "wraith feed",
37 });
38 
40  setProperty(tipProperty, tr("Display all attack messages."));
41  for (uint8_t type = 0; type < types.size(); type++) {
42  myChildren.push_back(new SingleAttackWrapper(this, type, types[type]));
43  }
44 }
45 
47  for (size_t i = 0; i < myChildren.size(); i++) {
48  if (asset == myChildren[i]) {
49  return i;
50  }
51  }
52  return -1;
53 }
AssetWrapper::tipProperty
static const char * tipProperty
Definition: AssetWrapper.h:34
SingleAttackWrapper
Definition: AttackMessagesWrapper.h:18
AssetWrapper
Definition: AssetWrapper.h:25
types
static std::vector< const char * > types({ "arrow", "drain", "electricity", "cold", "fire", "basic attack", "karate", "claw", "punch", "slash", "pierce", "cleave", "slice", "stab", "whip", "crush", "blud", "door", "poison and disease", "wraith feed", })
AttackMessagesWrapper::AttackMessagesWrapper
AttackMessagesWrapper(AssetWrapper *parent)
Definition: AttackMessagesWrapper.cpp:39
AttackMessagesWrapper::childIndex
virtual int childIndex(AssetWrapper *asset)
Definition: AttackMessagesWrapper.cpp:46
AttackMessagesWrapper::myChildren
std::vector< SingleAttackWrapper * > myChildren
Definition: AttackMessagesWrapper.h:43
AttackMessagesWrapper.h
AttackMessagePanel.h
is_valid_types_gen.type
list type
Definition: is_valid_types_gen.py:25