123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- // Flexlay - A Generic 2D Game Editor
- // Copyright (C) 2002 Ingo Ruhnke <grumbel@gmx.de>
- //
- // This program is free software: you can redistribute it and/or modify
- // it under the terms of the GNU General Public License as published by
- // the Free Software Foundation, either version 3 of the License, or
- // (at your option) any later version.
- //
- // This program is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- // GNU General Public License for more details.
- //
- // You should have received a copy of the GNU General Public License
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
- #include "objmap_object_impl.hpp"
- ObjMapObject::ObjMapObject()
- {
- }
- ObjMapObject::ObjMapObject(const std::shared_ptr<ObjMapObjectImpl>& impl_)
- : impl(impl_)
- {
- }
- CL_Pointf
- ObjMapObject::get_pos() const
- {
- if (impl.get())
- return impl->pos;
- else
- return CL_Pointf();
- }
- void
- ObjMapObject::set_pos(const CL_Pointf& p)
- {
- if (impl.get())
- {
- impl->pos = p;
- }
- }
- MetaData
- ObjMapObject::get_metadata() const
- {
- if (impl.get())
- return impl->data;
- else
- return MetaData();
- }
- void
- ObjMapObject::set_metadata(const MetaData& data_)
- {
- if (impl.get())
- impl->data = data_;
- }
- void
- ObjMapObject::draw(CL_GraphicContext* gc)
- {
- if (impl.get())
- impl->draw(gc);
- }
- CL_Rectf
- ObjMapObject::get_bound_rect() const
- {
- if (impl.get())
- return impl->get_bound_rect();
- else
- return CL_Rect();
- }
- bool
- ObjMapObject::is_null() const
- {
- return !impl.get();
- }
- bool
- ObjMapObject::operator==(const ObjMapObject& obj) const
- {
- return impl.get() == obj.impl.get();
- }
- bool
- ObjMapObject::operator<(const ObjMapObject& obj) const
- {
- return impl.get() < obj.impl.get();
- }
- CL_Signal_v1<ObjMapObject>&
- ObjMapObject::sig_select()
- {
- return impl->on_select;
- }
- CL_Signal_v1<ObjMapObject>&
- ObjMapObject::sig_deselect()
- {
- return impl->on_deselect;
- }
- CL_Signal_v1<ObjMapObject>&
- ObjMapObject::sig_move()
- {
- return impl->on_move;
- }
- void
- ObjMapObject::add_control_points()
- {
- impl->add_control_points();
- }
- void
- ObjMapObject::update_control_points()
- {
- impl->update_control_points();
- }
- /* EOF */
|