Otclient  14/8/2020
outfit.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2020 OTClient <https://github.com/edubart/otclient>
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  */
22 
23 #ifndef OUTFIT_H
24 #define OUTFIT_H
25 
26 #include <framework/util/color.h>
27 #include "thingtypemanager.h"
28 
29 class Outfit
30 {
31  enum {
32  HSI_SI_VALUES = 7,
33  HSI_H_STEPS = 19
34  };
35 
36 public:
37  Outfit();
38 
39  static Color getColor(int color);
40 
41  void setId(int id) { m_id = id; }
42  void setAuxId(int id) { m_auxId = id; }
43  void setHead(int head) { m_head = head; m_headColor = getColor(head); }
44  void setBody(int body) { m_body = body; m_bodyColor = getColor(body); }
45  void setLegs(int legs) { m_legs = legs; m_legsColor = getColor(legs); }
46  void setFeet(int feet) { m_feet = feet; m_feetColor = getColor(feet); }
47  void setAddons(int addons) { m_addons = addons; }
48  void setMount(int mount) { m_mount = mount; }
49  void setCategory(ThingCategory category) { m_category = category; }
50 
51  void resetClothes();
52 
53  int getId() const { return m_id; }
54  int getAuxId() const { return m_auxId; }
55  int getHead() const { return m_head; }
56  int getBody() const { return m_body; }
57  int getLegs() const { return m_legs; }
58  int getFeet() const { return m_feet; }
59  int getAddons() const { return m_addons; }
60  int getMount() const { return m_mount; }
61  ThingCategory getCategory() const { return m_category; }
62 
63  Color getHeadColor() const { return m_headColor; }
64  Color getBodyColor() const { return m_bodyColor; }
65  Color getLegsColor() const { return m_legsColor; }
66  Color getFeetColor() const { return m_feetColor; }
67 
68 private:
69  ThingCategory m_category;
70  int m_id, m_auxId, m_head, m_body, m_legs, m_feet, m_addons, m_mount;
71  Color m_headColor, m_bodyColor, m_legsColor, m_feetColor;
72 };
73 
74 #endif
Outfit::getMount
int getMount() const
Definition: outfit.h:60
Outfit::getColor
static Color getColor(int color)
Definition: outfit.cpp:33
thingtypemanager.h
Outfit::Outfit
Outfit()
Definition: outfit.cpp:25
Outfit::setBody
void setBody(int body)
Definition: outfit.h:44
Color
Definition: color.h:32
Outfit::getBody
int getBody() const
Definition: outfit.h:56
Outfit::setFeet
void setFeet(int feet)
Definition: outfit.h:46
Outfit::getId
int getId() const
Definition: outfit.h:53
Outfit::setAddons
void setAddons(int addons)
Definition: outfit.h:47
Outfit::setCategory
void setCategory(ThingCategory category)
Definition: outfit.h:49
Outfit::getFeet
int getFeet() const
Definition: outfit.h:58
Outfit::getAddons
int getAddons() const
Definition: outfit.h:59
Outfit::setAuxId
void setAuxId(int id)
Definition: outfit.h:42
Outfit::getBodyColor
Color getBodyColor() const
Definition: outfit.h:64
Outfit
Definition: outfit.h:29
Outfit::getLegs
int getLegs() const
Definition: outfit.h:57
Outfit::setId
void setId(int id)
Definition: outfit.h:41
Outfit::setHead
void setHead(int head)
Definition: outfit.h:43
Outfit::setMount
void setMount(int mount)
Definition: outfit.h:48
Outfit::getHeadColor
Color getHeadColor() const
Definition: outfit.h:63
Outfit::getAuxId
int getAuxId() const
Definition: outfit.h:54
Outfit::resetClothes
void resetClothes()
Definition: outfit.cpp:124
Outfit::getFeetColor
Color getFeetColor() const
Definition: outfit.h:66
Outfit::getCategory
ThingCategory getCategory() const
Definition: outfit.h:61
color.h
Outfit::getHead
int getHead() const
Definition: outfit.h:55
ThingCategory
ThingCategory
Definition: thingtype.h:42
Outfit::getLegsColor
Color getLegsColor() const
Definition: outfit.h:65
Outfit::setLegs
void setLegs(int legs)
Definition: outfit.h:45