Simon added Copy method to ComponentWrapper. Its being used in PlayerDeathSystem to copy model,animation,transform. TODO: 3rd person camera, cleanup, tests

This commit is contained in:
verysecrethero
2016-01-27 18:00:31 +01:00
parent 5cdf6db340
commit 7497ff39d2
4 changed files with 77 additions and 4 deletions
+5
View File
@@ -43,6 +43,11 @@ struct ComponentWrapper
// Specialization for string literals
template <std::size_t N>
void SetField(std::string name, const char(&value)[N]) { Field<std::string>(name) = std::string(value); }
void Copy(ComponentWrapper& destination)
{
memcpy(destination.Data, this->Data, Info.Stride);
}
struct SubscriptProxy
{
+2 -1
View File
@@ -2,7 +2,7 @@
#define EPlayerDeath_h__
#include "EventBroker.h"
#include "../Core/Entity.h"
#include "../Core/EntityWrapper.h"
namespace Events
{
@@ -12,6 +12,7 @@ struct PlayerDeath : Event
//KilledBy,KilledByWhat is optional for now. It might be used later in the playerlog-system
EntityID KilledBy;
EntityID PlayerID;
EntityWrapper Player;
std::string KilledByWhat;
};