Skip to content

Commit

Permalink
Reduced coupling between creature and message builder
Browse files Browse the repository at this point in the history
  • Loading branch information
apathyboy committed Apr 1, 2012
1 parent 9bb5dc1 commit b3f4010
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 95 deletions.
30 changes: 30 additions & 0 deletions src/swganh/object/creature/creature.cc
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,21 @@ uint64_t Creature::GetInviteSenderId(void)
return invite_sender_id_;
}

void Creature::SetInviteCounter(uint64_t invite_counter)
{
invite_counter_ = invite_counter;
}

uint64_t Creature::IncrementInviteCounter()
{
return invite_counter_++;
}

uint64_t Creature::GetInviteCounter(void) const
{
return invite_counter_;
}

void Creature::SetGuildId(uint32_t guild_id)
{
guild_id_ = guild_id;
Expand Down Expand Up @@ -729,6 +744,21 @@ uint32_t Creature::GetPerformanceId(void)
{
return performance_id_;
}

void Creature::SetPerformanceCounter(uint32_t performance_counter)
{
performance_counter_ = performance_counter;
}

uint32_t Creature::IncrementPerformanceCounter()
{
return performance_counter_++;
}

uint32_t Creature::GetPerformanceCounter(void) const
{
return performance_counter_;
}

void Creature::SetStatCurrent(StatIndex stat_index, int32_t value)
{
Expand Down
11 changes: 10 additions & 1 deletion src/swganh/object/creature/creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,11 @@ class Creature : public swganh::object::tangible::Tangible
// Invite Sender Id
void SetInviteSenderId(uint64_t invite_sender_id);
uint64_t GetInviteSenderId(void);

// Invite Counter
void SetInviteCounter(uint64_t invite_counter);
uint64_t IncrementInviteCounter();
uint64_t GetInviteCounter(void) const;

// Guild Id
void SetGuildId(uint32_t guild_id);
Expand All @@ -553,6 +558,11 @@ class Creature : public swganh::object::tangible::Tangible
// Performance Id
void SetPerformanceId(uint32_t performance_id);
uint32_t GetPerformanceId(void);

// Performance Counter
void SetPerformanceCounter(uint32_t performance_counter);
uint32_t IncrementPerformanceCounter();
uint32_t GetPerformanceCounter(void) const;

// Current Stats
void SetStatCurrent(StatIndex stat_index, int32_t value);
Expand Down Expand Up @@ -606,7 +616,6 @@ class Creature : public swganh::object::tangible::Tangible
std::shared_ptr<swganh::object::player::Player> GetPlayer();

private:
friend class CreatureMessageBuilder;
friend class CreatureFactory;

void OnMakeClean(std::shared_ptr<swganh::object::ObjectController> controller);
Expand Down
Loading

0 comments on commit b3f4010

Please sign in to comment.