X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FTypeDescription.cpp;h=1bb6c6505309117000822b92135c616cfb1d92a3;hb=5f9a1893c0db8f53889a390e4c4b95d57abd4384;hp=bcc480c6af6659ef6241c14bcf97a59ee01a68ad;hpb=1907ca03c5e865c4d398170042aa384c67ffff29;p=l2e.git diff --git a/src/loader/TypeDescription.cpp b/src/loader/TypeDescription.cpp index bcc480c..1bb6c65 100644 --- a/src/loader/TypeDescription.cpp +++ b/src/loader/TypeDescription.cpp @@ -1,10 +1,3 @@ -/* - * TypeDescription.cpp - * - * Created on: Sep 4, 2012 - * Author: holy - */ - #include "TypeDescription.h" #include @@ -30,6 +23,9 @@ void TypeDescription::AddField(const std::string &n, const FieldDescription &f) } else { fields.insert(std::make_pair(n, f)); } + if (f.IsReferenced() || f.IsAggregate()) { + link = true; + } } bool TypeDescription::HasField(const std::string &name) const { @@ -114,6 +110,20 @@ const TypeDescription &TypeDescription::Get(int id) { } +int TypeDescription::GetMaxSize() { + int max = 0; + for (map::const_iterator + i(typeDescriptions.begin()), + end(typeDescriptions.end()); + i != end; ++i) { + if (i->second.Size() > max) { + max = i->second.Size(); + } + } + return max; +} + + void TypeDescription::WriteSourceWiki(std::ostream &out) { vector types; for (map::const_iterator i(typeDescriptions.begin()), end(typeDescriptions.end()); i != end; ++i) { @@ -134,6 +144,8 @@ void TypeDescription::WriteSourceWiki(std::ostream &out) { const TypeDescription &td(Get(GetTypeId(*i))); out << "h3. " << td.TypeName() << endl << endl; + out << "Type ID: @" << td.TypeId() << "@" << endl << endl; + if (td.Description()) { out << td.Description() << endl << endl; }