X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FPartyLayout.cpp;h=00fa930f9eb711853e469e32c61bc14d456ad96d;hb=5f9a1893c0db8f53889a390e4c4b95d57abd4384;hp=ad0a54877c6b3c53e9266ea76cdeaa5c869cd2e4;hpb=06cdcf42d8f86955419bcf8ca3457f1d59a14707;p=l2e.git diff --git a/src/battle/PartyLayout.cpp b/src/battle/PartyLayout.cpp index ad0a548..00fa930 100644 --- a/src/battle/PartyLayout.cpp +++ b/src/battle/PartyLayout.cpp @@ -1,16 +1,11 @@ -/* - * PartyLayout.cpp - * - * Created on: Aug 5, 2012 - * Author: holy - */ - #include "PartyLayout.h" +#include "../loader/Interpreter.h" #include "../loader/TypeDescription.h" -using geometry::Vector; +using math::Vector; using loader::FieldDescription; +using loader::Interpreter; using loader::TypeDescription; using std::vector; @@ -38,13 +33,17 @@ void PartyLayout::CalculatePositions(int width, int height, vector > void PartyLayout::CreateTypeDescription() { PartyLayout p; - TypeDescription &td(TypeDescription::CreateOrGet("PartyLayout")); + TypeDescription &td(TypeDescription::Create(TYPE_ID, "PartyLayout")); + td.SetDescription("Positions of party members"); + td.SetConstructor(&Construct); td.SetSize(sizeof(PartyLayout)); - int vectorId(TypeDescription::GetTypeId("Vector")); + td.AddField("positions", FieldDescription(((char *)&p.positions) - ((char *)&p), Interpreter::VECTOR_ID).SetAggregate().SetDescription("the members' positions")); +} - td.AddField("positions", FieldDescription(((char *)&p.positions) - ((char *)&p), vectorId, true, true)); +void PartyLayout::Construct(void *data) { + new (data) PartyLayout; } }