Skip to content
Browse files

Reduced coupling between creature and message builder

  • Loading branch information...
1 parent 9bb5dc1 commit b3f4010327c8e454ef1a03c59d2037c615023647 @apathyboy apathyboy committed Apr 1, 2012
View
30 src/swganh/object/creature/creature.cc
@@ -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;
@@ -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)
{
View
11 src/swganh/object/creature/creature.h
@@ -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);
@@ -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);
@@ -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);
View
188 src/swganh/object/creature/creature_message_builder.cc
@@ -11,7 +11,7 @@ void CreatureMessageBuilder::BuildBankCreditsDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_1, 0);
- message.data.write<uint32_t>(creature->bank_credits_); // Bank Credits
+ message.data.write<uint32_t>(creature->GetBankCredits()); // Bank Credits
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -21,7 +21,7 @@ void CreatureMessageBuilder::BuildCashCreditsDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_1, 1);
- message.data.write<uint32_t>(creature->cash_credits_); // Cash Credits
+ message.data.write<uint32_t>(creature->GetCashCredits()); // Cash Credits
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -31,23 +31,23 @@ void CreatureMessageBuilder::BuildStatBaseDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_1, 2);
- creature->stat_base_list_.Serialize(message);
+ creature->GetBaseStats().Serialize(message);
creature->AddDeltasUpdate(std::move(message));
}
else
- creature->stat_base_list_.ClearDeltas();
+ creature->GetBaseStats().ClearDeltas();
}
void CreatureMessageBuilder::BuildSkillDelta(Creature* creature)
{
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_1, 3);
- creature->skills_.Serialize(message);
+ creature->GetSkills().Serialize(message);
creature->AddDeltasUpdate(std::move(message));
}
else
- creature->skills_.ClearDeltas();
+ creature->GetSkills().ClearDeltas();
}
void CreatureMessageBuilder::BuildPostureUpdate(Creature* creature)
@@ -66,7 +66,7 @@ void CreatureMessageBuilder::BuildPostureDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_3, 11);
- message.data.write<uint8_t>(creature->posture_);
+ message.data.write<uint8_t>(creature->GetPosture());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -76,7 +76,7 @@ void CreatureMessageBuilder::BuildFactionRankDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_3, 12);
- message.data.write<uint8_t>(creature->faction_rank_);
+ message.data.write<uint8_t>(creature->GetFactionRank());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -86,7 +86,7 @@ void CreatureMessageBuilder::BuildOwnerIdDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_3, 13);
- message.data.write<uint64_t>(creature->owner_id_);
+ message.data.write<uint64_t>(creature->GetOwnerId());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -96,7 +96,7 @@ void CreatureMessageBuilder::BuildScaleDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_3, 14);
- message.data.write<float>(creature->scale_);
+ message.data.write<float>(creature->GetScale());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -106,7 +106,7 @@ void CreatureMessageBuilder::BuildBattleFatigueDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_3, 15);
- message.data.write<uint32_t>(creature->battle_fatigue_);
+ message.data.write<uint32_t>(creature->GetBattleFatigue());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -116,7 +116,7 @@ void CreatureMessageBuilder::BuildStateBitmaskDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_3, 16);
- message.data.write<uint64_t>(creature->state_bitmask_);
+ message.data.write<uint64_t>(creature->GetStateBitmask());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -126,19 +126,19 @@ void CreatureMessageBuilder::BuildStatWoundDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_3, 17);
- creature->stat_wound_list_.Serialize(message);
+ creature->GetStatWounds().Serialize(message);
creature->AddDeltasUpdate(std::move(message));
}
else
- creature->stat_wound_list_.ClearDeltas();
+ creature->GetStatWounds().ClearDeltas();
}
void CreatureMessageBuilder::BuildAccelerationMultiplierBaseDelta(Creature* creature)
{
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 0);
- message.data.write<float>(creature->acceleration_multiplier_base_);
+ message.data.write<float>(creature->GetAccelerationMultiplierBase());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -148,7 +148,7 @@ void CreatureMessageBuilder::BuildAccelerationMultiplierModifierDelta(Creature*
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 1);
- message.data.write<float>(creature->acceleration_multiplier_modifier_);
+ message.data.write<float>(creature->GetAccelerationMultiplierModifier());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -158,31 +158,31 @@ void CreatureMessageBuilder::BuildStatEncumberanceDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 2);
- creature->stat_encumberance_list_.Serialize(message);
+ creature->GetStatEncumberances().Serialize(message);
creature->AddDeltasUpdate(std::move(message));
}
else
- creature->stat_encumberance_list_.ClearDeltas();
+ creature->GetStatEncumberances().ClearDeltas();
}
void CreatureMessageBuilder::BuildSkillModDelta(Creature* creature)
{
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 3);
- creature->skill_mod_list_.Serialize(message);
+ creature->GetSkillMods().Serialize(message);
creature->AddDeltasUpdate(std::move(message));
}
else
- creature->skill_mod_list_.ClearDeltas();
+ creature->GetSkillMods().ClearDeltas();
}
void CreatureMessageBuilder::BuildSpeedMultiplierBaseDelta(Creature* creature)
{
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 4);
- message.data.write<float>(creature->speed_multiplier_base_);
+ message.data.write<float>(creature->GetSpeedMultiplierBase());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -192,7 +192,7 @@ void CreatureMessageBuilder::BuildSpeedMultiplierModifierDelta(Creature* creatur
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 5);
- message.data.write<float>(creature->speed_multiplier_modifier_);
+ message.data.write<float>(creature->GetSpeedMultiplierModifier());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -202,7 +202,7 @@ void CreatureMessageBuilder::BuildListenToIdDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 6);
- message.data.write<uint64_t>(creature->listen_to_id_);
+ message.data.write<uint64_t>(creature->GetListenToId());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -212,7 +212,7 @@ void CreatureMessageBuilder::BuildRunSpeedDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 7);
- message.data.write<float>(creature->run_speed_);
+ message.data.write<float>(creature->GetRunSpeed());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -222,7 +222,7 @@ void CreatureMessageBuilder::BuildSlopeModifierAngleDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 8);
- message.data.write<float>(creature->slope_modifier_angle_);
+ message.data.write<float>(creature->GetSlopeModifierAngle());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -232,7 +232,7 @@ void CreatureMessageBuilder::BuildSlopeModifierPercentDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 9);
- message.data.write<float>(creature->slope_modifier_percent_);
+ message.data.write<float>(creature->GetSlopeModifierPercent());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -242,7 +242,7 @@ void CreatureMessageBuilder::BuildTurnRadiusDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 10);
- message.data.write<float>(creature->turn_radius_);
+ message.data.write<float>(creature->GetTurnRadius());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -252,7 +252,7 @@ void CreatureMessageBuilder::BuildWalkingSpeedDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 11);
- message.data.write<float>(creature->walking_speed_);
+ message.data.write<float>(creature->GetWalkingSpeed());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -262,7 +262,7 @@ void CreatureMessageBuilder::BuildWaterModifierPrecentDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 12);
- message.data.write<float>(creature->water_modifier_percent_);
+ message.data.write<float>(creature->GetWaterModifierPercent());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -272,19 +272,19 @@ void CreatureMessageBuilder::BuildMissionCriticalObjectDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_4, 13);
- creature->mission_critical_object_list_.Serialize(message);
+ creature->GetMissionCriticalObjects().Serialize(message);
creature->AddDeltasUpdate(std::move(message));
}
else
- creature->mission_critical_object_list_.ClearDeltas();
+ creature->GetMissionCriticalObjects().ClearDeltas();
}
void CreatureMessageBuilder::BuildCombatLevelDelta(Creature* creature)
{
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 2);
- message.data.write<uint16_t>(creature->combat_level_);
+ message.data.write<uint16_t>(creature->GetCombatLevel());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -294,7 +294,7 @@ void CreatureMessageBuilder::BuildAnimationDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 3);
- message.data.write<std::string>(creature->animation_);
+ message.data.write<std::string>(creature->GetAnimation());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -304,7 +304,7 @@ void CreatureMessageBuilder::BuildMoodAnimationDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 4);
- message.data.write<std::string>(creature->mood_animation_);
+ message.data.write<std::string>(creature->GetMoodAnimation());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -314,7 +314,7 @@ void CreatureMessageBuilder::BuildWeaponIdDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 5);
- message.data.write<uint64_t>(creature->weapon_id_);
+ message.data.write<uint64_t>(creature->GetWeaponId());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -324,7 +324,7 @@ void CreatureMessageBuilder::BuildGroupIdDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 6);
- message.data.write<uint64_t>(creature->group_id_);
+ message.data.write<uint64_t>(creature->GetGroupId());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -334,8 +334,8 @@ void CreatureMessageBuilder::BuildInviteSenderIdDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 7);
- message.data.write<uint64_t>(creature->invite_counter_++);
- message.data.write<uint64_t>(creature->invite_sender_id_);
+ message.data.write<uint64_t>(creature->IncrementInviteCounter());
+ message.data.write<uint64_t>(creature->GetInviteSenderId());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -345,7 +345,7 @@ void CreatureMessageBuilder::BuildGuildIdDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 8);
- message.data.write<uint32_t>(creature->guild_id_);
+ message.data.write<uint32_t>(creature->GetGuildId());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -355,7 +355,7 @@ void CreatureMessageBuilder::BuildTargetIdDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 9);
- message.data.write<uint64_t>(creature->target_id_);
+ message.data.write<uint64_t>(creature->GetTargetId());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -365,7 +365,7 @@ void CreatureMessageBuilder::BuildMoodIdDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 10);
- message.data.write<uint8_t>(creature->mood_id_);
+ message.data.write<uint8_t>(creature->GetMoodId());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -375,7 +375,7 @@ void CreatureMessageBuilder::BuildPerformanceIdDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 12);
- message.data.write<uint32_t>(creature->performance_id_);
+ message.data.write<uint32_t>(creature->GetPerformanceId());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -385,43 +385,43 @@ void CreatureMessageBuilder::BuildStatCurrentDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 13);
- creature->stat_current_list_.Serialize(message);
+ creature->GetCurrentStats().Serialize(message);
creature->AddDeltasUpdate(std::move(message));
}
else
- creature->stat_current_list_.ClearDeltas();
+ creature->GetCurrentStats().ClearDeltas();
}
void CreatureMessageBuilder::BuildStatMaxDelta(Creature* creature)
{
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 14);
- creature->stat_max_list_.Serialize(message);
+ creature->GetMaxStats().Serialize(message);
creature->AddDeltasUpdate(std::move(message));
}
else
- creature->stat_max_list_.ClearDeltas();
+ creature->GetMaxStats().ClearDeltas();
}
void CreatureMessageBuilder::BuildEquipmentDelta(Creature* creature)
{
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 15);
- creature->equipment_list_.Serialize(message);
+ creature->GetEquipment().Serialize(message);
creature->AddDeltasUpdate(std::move(message));
}
else
- creature->equipment_list_.ClearDeltas();
+ creature->GetEquipment().ClearDeltas();
}
void CreatureMessageBuilder::BuildDisguiseDelta(Creature* creature)
{
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 16);
- message.data.write<std::string>(creature->disguise_);
+ message.data.write<std::string>(creature->GetDisguise());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -431,7 +431,7 @@ void CreatureMessageBuilder::BuildStationaryDelta(Creature* creature)
if (creature->HasObservers())
{
DeltasMessage message = creature->CreateDeltasMessage(Object::VIEW_6, 17);
- message.data.write<uint8_t>(creature->stationary_);
+ message.data.write<uint8_t>(creature->IsStationary());
creature->AddDeltasUpdate(std::move(message));
}
}
@@ -442,9 +442,9 @@ void CreatureMessageBuilder::BuildUpdatePvpStatusMessage(Creature* creature)
if (creature->HasObservers())
{
UpdatePvpStatusMessage message;
- message.object_id = creature->object_id_;
+ message.object_id = creature->GetObjectId();
message.faction = 0;
- message.pvp_status = creature->pvp_status_;
+ message.pvp_status = creature->GetPvpStatus();
creature->NotifyObservers(message);
}
@@ -453,67 +453,67 @@ void CreatureMessageBuilder::BuildUpdatePvpStatusMessage(Creature* creature)
boost::optional<swganh::messages::BaselinesMessage> CreatureMessageBuilder::BuildBaseline1(Creature* creature)
{
auto message = creature->CreateBaselinesMessage(Object::VIEW_1, 4);
- message.data.write<uint32_t>(creature->bank_credits_); // Bank Credits
- message.data.write<uint32_t>(creature->cash_credits_); // Cash Credits
- creature->stat_base_list_.Serialize(message); // Stats Negative
- creature->skills_.Serialize(message); // Skills
+ message.data.write<uint32_t>(creature->GetBankCredits()); // Bank Credits
+ message.data.write<uint32_t>(creature->GetCashCredits()); // Cash Credits
+ creature->GetBaseStats().Serialize(message); // Stats Negative
+ creature->GetSkills().Serialize(message); // Skills
return boost::optional<swganh::messages::BaselinesMessage>(std::move(message));
}
boost::optional<swganh::messages::BaselinesMessage> CreatureMessageBuilder::BuildBaseline3(Creature* creature)
{
auto message = creature->CreateBaselinesMessage(Object::VIEW_3, 18);
message.data.append(creature->Tangible::GetBaseline3().get().data);
- message.data.write<uint8_t>(creature->posture_); // Posture
- message.data.write<uint8_t>(creature->faction_rank_); // Faction Rank
- message.data.write<uint64_t>(creature->owner_id_); // Owner Id
- message.data.write<float>(creature->scale_); // Scale
- message.data.write<uint32_t>(creature->battle_fatigue_); // Battle Fatigue
- message.data.write<uint64_t>(creature->state_bitmask_); // States Bitmask
- creature->stat_wound_list_.Serialize(message); // Stat Wounds
+ message.data.write<uint8_t>(creature->GetPosture()); // Posture
+ message.data.write<uint8_t>(creature->GetFactionRank()); // Faction Rank
+ message.data.write<uint64_t>(creature->GetOwnerId()); // Owner Id
+ message.data.write<float>(creature->GetScale()); // Scale
+ message.data.write<uint32_t>(creature->GetBattleFatigue()); // Battle Fatigue
+ message.data.write<uint64_t>(creature->GetStateBitmask()); // States Bitmask
+ creature->GetStatWounds().Serialize(message); // Stat Wounds
return boost::optional<swganh::messages::BaselinesMessage>(std::move(message));
}
boost::optional<swganh::messages::BaselinesMessage> CreatureMessageBuilder::BuildBaseline4(Creature* creature)
{
auto message = creature->CreateBaselinesMessage(Object::VIEW_4, 20);
- message.data.write<float>(creature->acceleration_multiplier_base_); // Acceleration Multiplier Base
- message.data.write<float>(creature->acceleration_multiplier_modifier_); // Acceleration Multiplier Modifier
- creature->stat_encumberance_list_.Serialize(message); // Stat Encumberances
- creature->skill_mod_list_.Serialize(message); // Skill Mods
- message.data.write<float>(creature->speed_multiplier_base_); // Speed Multiplier Base
- message.data.write<float>(creature->speed_multiplier_modifier_); // Speed Multiplier Modifier
- message.data.write<uint64_t>(creature->listen_to_id_); // Listen To Id
- message.data.write<float>(creature->run_speed_); // Run Speed
- message.data.write<float>(creature->slope_modifier_angle_); // Slope Modifier Angle
- message.data.write<float>(creature->slope_modifier_percent_); // Slope Modifier Percent
- message.data.write<float>(creature->turn_radius_); // Turn Radius
- message.data.write<float>(creature->walking_speed_); // Walking Speed
- message.data.write<float>(creature->water_modifier_percent_); // Water Modifier Percent
- creature->mission_critical_object_list_.Serialize(message); // Mission Critical Object
+ message.data.write<float>(creature->GetAccelerationMultiplierBase()); // Acceleration Multiplier Base
+ message.data.write<float>(creature->GetAccelerationMultiplierModifier()); // Acceleration Multiplier Modifier
+ creature->GetStatEncumberances().Serialize(message); // Stat Encumberances
+ creature->GetSkillMods().Serialize(message); // Skill Mods
+ message.data.write<float>(creature->GetSpeedMultiplierBase()); // Speed Multiplier Base
+ message.data.write<float>(creature->GetSpeedMultiplierModifier()); // Speed Multiplier Modifier
+ message.data.write<uint64_t>(creature->GetListenToId()); // Listen To Id
+ message.data.write<float>(creature->GetRunSpeed()); // Run Speed
+ message.data.write<float>(creature->GetSlopeModifierAngle()); // Slope Modifier Angle
+ message.data.write<float>(creature->GetSlopeModifierPercent()); // Slope Modifier Percent
+ message.data.write<float>(creature->GetTurnRadius()); // Turn Radius
+ message.data.write<float>(creature->GetWalkingSpeed()); // Walking Speed
+ message.data.write<float>(creature->GetWaterModifierPercent()); // Water Modifier Percent
+ creature->GetMissionCriticalObjects().Serialize(message); // Mission Critical Object
return boost::optional<swganh::messages::BaselinesMessage>(std::move(message));
}
boost::optional<swganh::messages::BaselinesMessage> CreatureMessageBuilder::BuildBaseline6(Creature* creature)
{
auto message = creature->CreateBaselinesMessage(Object::VIEW_6, 23);
message.data.append(creature->Tangible::GetBaseline6().get().data);
- message.data.write<uint16_t>(creature->combat_level_); // Combat Level
- message.data.write<std::string>(creature->animation_); // Current Animation
- message.data.write<std::string>(creature->mood_animation_); // Mood Animation
- message.data.write<uint64_t>(creature->weapon_id_); // Weapon Id
- message.data.write<uint64_t>(creature->group_id_); // Group Id
- message.data.write<uint64_t>(creature->invite_sender_id_); // Invite Sender Id
- message.data.write<uint64_t>(creature->invite_counter_++); // Invite Sender Counter
- message.data.write<uint32_t>(creature->guild_id_); // Guild Id
- message.data.write<uint64_t>(creature->target_id_); // Target Id
- message.data.write<uint8_t>(creature->mood_id_); // Mood Id
- message.data.write<uint32_t>(creature->performance_counter_++); // Performance Update Counter
- message.data.write<uint32_t>(creature->performance_id_); // Performance Id
- creature->stat_current_list_.Serialize(message); // Current Stats
- creature->stat_max_list_.Serialize(message); // Max Stats
- creature->equipment_list_.Serialize(message); // Equipment
- message.data.write<std::string>(creature->disguise_); // Disguise Template
- message.data.write<uint8_t>(creature->stationary_); // Stationary
+ message.data.write<uint16_t>(creature->GetCombatLevel()); // Combat Level
+ message.data.write<std::string>(creature->GetAnimation()); // Current Animation
+ message.data.write<std::string>(creature->GetMoodAnimation()); // Mood Animation
+ message.data.write<uint64_t>(creature->GetWeaponId()); // Weapon Id
+ message.data.write<uint64_t>(creature->GetGroupId()); // Group Id
+ message.data.write<uint64_t>(creature->GetInviteSenderId()); // Invite Sender Id
+ message.data.write<uint64_t>(creature->IncrementInviteCounter()); // Invite Sender Counter
+ message.data.write<uint32_t>(creature->GetGuildId()); // Guild Id
+ message.data.write<uint64_t>(creature->GetTargetId()); // Target Id
+ message.data.write<uint8_t>(creature->GetMoodId()); // Mood Id
+ message.data.write<uint32_t>(creature->IncrementPerformanceCounter()); // Performance Update Counter
+ message.data.write<uint32_t>(creature->GetPerformanceId()); // Performance Id
+ creature->GetCurrentStats().Serialize(message); // Current Stats
+ creature->GetMaxStats().Serialize(message); // Max Stats
+ creature->GetEquipment().Serialize(message); // Equipment
+ message.data.write<std::string>(creature->GetDisguise()); // Disguise Template
+ message.data.write<uint8_t>(creature->IsStationary()); // Stationary
return boost::optional<swganh::messages::BaselinesMessage>(std::move(message));
}

0 comments on commit b3f4010

Please sign in to comment.
Something went wrong with that request. Please try again.