Protected inheritance, not even once.

This commit is contained in:
2016-02-11 11:36:39 +01:00
parent e350074cb5
commit 81943516a9
8 changed files with 38 additions and 92 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ void RenderSystem::fillModels(RenderScene::Queues &Jobs)
// Hide things parented to local player if they have the HiddenFromLocalPlayer component
if ((entity.HasComponent("HiddenForLocalPlayer") || entity.FirstParentWithComponent("HiddenForLocalPlayer").Valid()) && (entity == m_LocalPlayer || entity.IsChildOf(m_LocalPlayer))) {
//continue;
continue;
}
Model* model;
+1 -1
View File
@@ -91,7 +91,7 @@ bool PlayerSpawnSystem::OnPlayerSpawned(Events::PlayerSpawned& e)
if (cameraEntity.Valid()) {
Events::SetCamera e;
e.CameraEntity = cameraEntity;
//m_EventBroker->Publish(e);
m_EventBroker->Publish(e);
}
// HACK: Set the player model color to team color
-11
View File
@@ -3,7 +3,6 @@
SoundSystem::SoundSystem(SystemParams params)
: System(params)
, PureSystem("SoundEmitter")
//, ImpureSystem()
{
ConfigFile* config = ResourceManager::Load<ConfigFile>("Config.ini");
m_Announcer = ResourceManager::Load<ConfigFile>("Config.ini")->Get<std::string>("Sound.Announcer", "female");
@@ -11,7 +10,6 @@ SoundSystem::SoundSystem(SystemParams params)
EVENT_SUBSCRIBE_MEMBER(m_InputCommand, &SoundSystem::OnInputCommand);
EVENT_SUBSCRIBE_MEMBER(m_EDoubleJump, &SoundSystem::OnDoubleJump);
EVENT_SUBSCRIBE_MEMBER(m_EDashAbility, &SoundSystem::OnDashAbility);
EVENT_SUBSCRIBE_MEMBER(m_EShoot, &SoundSystem::OnShoot);
EVENT_SUBSCRIBE_MEMBER(m_EPlayerDamage, &SoundSystem::OnPlayerDamage);
EVENT_SUBSCRIBE_MEMBER(m_ECaptured, &SoundSystem::OnCaptured);
EVENT_SUBSCRIBE_MEMBER(m_ETriggerTouch, &SoundSystem::OnTriggerTouch);
@@ -90,15 +88,6 @@ bool SoundSystem::drumTimer(double dt)
}
}
bool SoundSystem::OnShoot(const Events::Shoot & e)
{
Events::PlaySoundOnEntity ev;
ev.EmitterID = LocalPlayer.ID;
ev.FilePath = "Audio/laser/laser1.wav";
m_EventBroker->Publish(ev);
return true;
}
bool SoundSystem::OnCaptured(const Events::Captured & e)
{
int homeTeam = (int)m_World->GetComponent(e.CapturePointID, "Team")["Team"];
+7 -10
View File
@@ -21,13 +21,11 @@ void WeaponSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& cPla
{
// Update potential weapon behaviour for player
auto it = m_ActiveWeapons.find(entity);
if (it != m_ActiveWeapons.end()) {
if (it->first.Valid()) {
it->second->Update(dt);
} else {
m_ActiveWeapons.erase(it);
}
if (it == m_ActiveWeapons.end()) {
selectWeapon(entity, 1);
}
m_ActiveWeapons.at(entity)->Update(dt);
}
bool WeaponSystem::OnInputCommand(Events::InputCommand& e)
@@ -45,7 +43,7 @@ bool WeaponSystem::OnInputCommand(Events::InputCommand& e)
// Weapon selection
if (e.Command == "SelectWeapon") {
if (e.Value != 0) {
selectWeapon(player, static_cast<ComponentInfo::EnumType>(e.Value));
//selectWeapon(player, static_cast<ComponentInfo::EnumType>(e.Value));
}
}
@@ -72,7 +70,7 @@ void WeaponSystem::selectWeapon(EntityWrapper player, ComponentInfo::EnumType sl
if (m_ActiveWeapons.count(player) == 0) {
m_ActiveWeapons.insert(std::make_pair(player, std::make_shared<AssaultWeaponBehaviour>(m_SystemParams, m_CollisionOctree, player)));
} else {
m_ActiveWeapons.erase(player);
//m_ActiveWeapons.erase(player);
}
}
@@ -86,7 +84,6 @@ bool WeaponSystem::OnPlayerSpawned(Events::PlayerSpawned& e)
{
// Select primary weapon on player spawn
// TODO: Select the active one specified by player component
selectWeapon(e.Player, 1);
return true;
}
@@ -137,4 +134,4 @@ bool WeaponSystem::OnShoot(Events::Shoot& eShoot)
m_EventBroker->Publish(ePlayerDamage);
return true;
}
}