X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftrigger%2Fsequence_trigger.cpp;h=28c4b540f5d12506543fc246a84f47d5b6a404a2;hb=8cecc7815e5ab5fe2b646dbe6aaa8e95cf08e71f;hp=98789cd1a3cbeaef925dbc6a00681cede3973226;hpb=2d97548e5cded4b201bbc10d6cec6232df03e9a4;p=supertux.git diff --git a/src/trigger/sequence_trigger.cpp b/src/trigger/sequence_trigger.cpp index 98789cd1a..28c4b540f 100644 --- a/src/trigger/sequence_trigger.cpp +++ b/src/trigger/sequence_trigger.cpp @@ -1,13 +1,40 @@ +// $Id$ +// +// SuperTux +// Copyright (C) 2005 Matthias Braun +// +// 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 2 +// 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, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA. + #include #include "sequence_trigger.h" -#include "utils/lispwriter.h" -#include "gameloop.h" +#include "game_session.h" +#include "lisp/lisp.h" +#include "lisp/writer.h" +#include "object_factory.h" -SequenceTrigger::SequenceTrigger(LispReader& reader) +SequenceTrigger::SequenceTrigger(const lisp::Lisp& reader) { - (void) reader; - // TODO + reader.get("x", bbox.p1.x); + reader.get("y", bbox.p1.y); + float w, h; + reader.get("width", w); + reader.get("height", h); + bbox.set_size(w, h); + reader.get("sequence", sequence_name); } SequenceTrigger::SequenceTrigger(const Vector& pos, const std::string& sequence) @@ -23,7 +50,7 @@ SequenceTrigger::~SequenceTrigger() } void -SequenceTrigger::write(LispWriter& writer) +SequenceTrigger::write(lisp::Writer& writer) { writer.start_list("sequencetrigger"); @@ -43,3 +70,5 @@ SequenceTrigger::event(Player& , EventType type) GameSession::current()->start_sequence(sequence_name); } } + +IMPLEMENT_FACTORY(SequenceTrigger, "sequencetrigger")