cyphesis/rulesets/LineProperty.cpp
Al Riddoch f221ecf2e7 2004-12-03 Al Riddoch <alriddoch@zepler.org>
* common/inheritance.cpp, common/inheritance.h, common/refno.h,
	  common/type_utils.h, rulesets/Entity.cpp, rulesets/LineProperty.cpp,
	  rulesets/MemMap.h, rulesets/Py_Oplist.h, rulesets/Script.h,
	  server/Account.cpp, server/Admin.cpp, server/EntityFactory.h,
	  server/Persistance.h, server/Player.cpp, server/WorldRouter.cpp,
	  tests/EntityExerciser.h, tests/type_utilstest.cpp:
	  Clean up some more redundant includes.
2004-12-03 16:57:31 +00:00

46 lines
1,011 B
C++

// This file may be redistributed and modified only under the terms of
// the GNU General Public License (See COPYING for details).
// Copyright (C) 2004 Alistair Riddoch
#include "LineProperty.h"
#include "common/type_utils.h"
#include "common/debug.h"
#include <wfmath/atlasconv.h>
#include <sstream>
#include <cassert>
static const bool debug_flag = false;
using Atlas::Message::Element;
using Atlas::Message::MapType;
using Atlas::Message::ListType;
using Atlas::Message::FloatType;
LineProperty::LineProperty(CoordList & data, unsigned int flags) :
PropertyBase(flags), m_data(data)
{
}
void LineProperty::get(Element & ent)
{
ent = ListType();
objectListAsMessage(m_data, ent.asList());
}
void LineProperty::set(const Element & ent)
{
if (ent.isList()) {
objectListFromMessage<Point3D, CoordList>(ent.asList(), m_data);
}
}
void LineProperty::add(const std::string & s, MapType & ent)
{
if (!m_data.empty()) {
get(ent[s]);
}
}