summaryrefslogtreecommitdiff
path: root/context.h
diff options
context:
space:
mode:
Diffstat (limited to 'context.h')
-rw-r--r--context.h56
1 files changed, 34 insertions, 22 deletions
diff --git a/context.h b/context.h
index b268acf..cf894ab 100644
--- a/context.h
+++ b/context.h
@@ -334,7 +334,15 @@ class TMenuListEntry : public TPlyGuildCardTag {
T entry;
void bswap();
- TMenuListEntry &operator=(const TMenuListEntry &src);
+ void assign(const TMenuListEntry &src);
+
+ TMenuListEntry &operator=(const TMenuListEntry &src) {
+ _assign(src);
+ return *this;
+ };
+
+ private:
+ void _assign(const TMenuListEntry &src);
} __packed__;
template <typename T, int num_entries, int num_pad_entries>
@@ -345,7 +353,7 @@ class TMenuList {
TArray<TMenuListEntry<T>, num_entries> entries;
void bswap();
- TMenuList &operator=(const TMenuList &src);
+ TMenuList &assign(const TMenuList &src);
} __packed__;
template <typename T, int num_entries>
@@ -355,7 +363,7 @@ class TMenuList<T, num_entries, 0> {
TArray<TMenuListEntry<T>, num_entries> entries;
void bswap();
- TMenuList &operator=(const TMenuList &src);
+ TMenuList &assign(const TMenuList &src);
} __packed__;
template <typename T, int num_pad_entries>
@@ -365,7 +373,7 @@ class TMenuList<T, 0, num_pad_entries> {
TArray<TMenuListEntry<T>, num_pad_entries> pad_entries;
void bswap();
- TMenuList &operator=(const TMenuList &src);
+ TMenuList &assign(const TMenuList &src);
} __packed__;
@@ -407,36 +415,33 @@ void TMenuListEntry<T>::bswap() {
}
template <typename T, int num_entries>
-TMenuList<T, num_entries, 0> &TMenuList<T, num_entries, 0>::operator=(const TMenuList<T, num_entries, 0> &src) {
- header = src.header;
- entries = src.entries;
+TMenuList<T, num_entries, 0> &TMenuList<T, num_entries, 0>::assign(const TMenuList<T, num_entries, 0> &src) {
+ *this = src;
return *this;
}
template <typename T, int num_pad_entries>
-TMenuList<T, 0, num_pad_entries> &TMenuList<T, 0, num_pad_entries>::operator=(const TMenuList<T, 0, num_pad_entries> &src) {
- header = src.header;
- pad_entries = src.pad_entries;
+TMenuList<T, 0, num_pad_entries> &TMenuList<T, 0, num_pad_entries>::assign(const TMenuList<T, 0, num_pad_entries> &src) {
+ *this = src;
return *this;
}
template <typename T, int num_entries, int num_pad_entries>
-TMenuList<T, num_entries, num_pad_entries> &TMenuList<T, num_entries, num_pad_entries>::operator=(const TMenuList<T, num_entries, num_pad_entries> &src) {
- header = src.header;
- if (num_pad_entries) {
- pad_entries = src.pad_entries;
- }
- if (num_entries) {
- entries = src.entries;
- }
+TMenuList<T, num_entries, num_pad_entries> &TMenuList<T, num_entries, num_pad_entries>::assign(const TMenuList<T, num_entries, num_pad_entries> &src) {
+ *this = src;
return *this;
}
template <typename T>
-TMenuListEntry<T> &TMenuListEntry<T>::operator=(const TMenuListEntry<T> &src) {
+void TMenuListEntry<T>::_assign(const TMenuListEntry<T> &src) {
+ TPlyGuildCardTag::assign(src);
+ entry = src.entry;
+}
+
+template <typename T>
+void TMenuListEntry<T>::assign(const TMenuListEntry<T> &src) {
TPlyGuildCardTag::operator=(src);
entry = src.entry;
- return *this;
}
// TMainTask.cpp
@@ -618,14 +623,21 @@ static inline void operator|=(object_flags &a, object_flags b) { a = a | b; };
class TPlyGuildCardTag {
public:
- TPlyGuildCardTag &operator=(const TPlyGuildCardTag &src);
void bswap();
+ void assign(const TPlyGuildCardTag &src);
+ void assign(const TPlyGuildCardTag *src);
PRIVATE_MEMBER_ACCESSORS(gc_tag, tag);
PRIVATE_MEMBER_ACCESSORS(u32, tag_u32);
PRIVATE_MEMBER_ACCESSORS(u32, guildcard_number);
-
private:
+ void _assign(const TPlyGuildCardTag &src) {
+ m_tag.tag0 = src.tag().tag0;
+ m_tag.tag1 = src.tag().tag1;
+ m_tag.tag2 = src.tag().tag2;
+ m_guildcard_number = src.guildcard_number();
+ };
+
union {
gc_tag m_tag;
u32 m_tag_u32;