/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2007 orx 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, or (at your option) any later version. ### File Specific: main-programmer: Fabian 'x3n' Landau co-programmer: */ #include "util/loading/load_param.h" #include "util/loading/factory.h" #include "mover_station.h" #include "debug.h" ObjectListDefinition(MoverStation); CREATE_FACTORY(MoverStation); MoverStation::MoverStation(const TiXmlElement* root) { PRINTF(0)("MoverStation %p erzeugt\n", this); this->rank = 0; this->relTargetCoor = Vector(0, 0, 0); this->relTargetDir = Quaternion(0, Vector(0, 0, 0)); this->delay = 0; this->movingTime = 0; this->stayOpenTime = 0; this->bAccelerate = false; this->bDecelerate = false; this->jumpToRank = 0; this->bJumpToRank = false; this->moveToRank = 0; this->bMoveToRank = false; this->bIsOpen = false; this->bIsClosed = false;; if (root != NULL) this->loadParams(root); } MoverStation::~MoverStation() { } void MoverStation::loadParams(const TiXmlElement* root) { WorldEntity::loadParams(root); LoadParam(root, "rank", this, MoverStation, setRank) .describe("The rank of the station in the stationlist of the mover.") .defaultValues(0); LoadParam(root, "rel-target-coor", this, MoverStation, setRelTargetCoor) .describe("The relative coordinates of the stations target.") .defaultValues(0, 0, 0); LoadParam(root, "rel-target-dir", this, MoverStation, setRelTargetDir) .describe("The relative direction of the stations target.") .defaultValues(0, 0, 0, 0); LoadParam(root, "delay", this, MoverStation, setDelay) .describe("The amount of time the mover waits, before he starts moving.") .defaultValues(0); LoadParam(root, "moving-time", this, MoverStation, setMovingTime) .describe("The amount of time the mover needs to move.") .defaultValues(0); LoadParam(root, "stay-open-time", this, MoverStation, setStayOpenTime) .describe("The amount of time the mover waits when he reached the target.") .defaultValues(0); LoadParam(root, "bAccelerate", this, MoverStation, setAccelerate) .describe("If true, the mover starts slowly and increases his speed."); LoadParam(root, "bDecelerate", this, MoverStation, setDecelerate) .describe("If true, the mover starts fast and decreases his speed."); LoadParam(root, "jump-to-rank", this, MoverStation, setJumpToRank) .describe("The rank of the station the mover should jump to, after reaching the target.") .defaultValues(0); LoadParam(root, "move-to-rank", this, MoverStation, setMoveToRank) .describe("The rank of the station the mover should move to (instead of rel-target-coor).") .defaultValues(0); LoadParam(root, "bOpen", this, MoverStation, setOpen) .describe("If true, the mover changes to state 'open' after reaching this station."); LoadParam(root, "bClosed", this, MoverStation, setClosed) .describe("If true, the mover changes to state 'closed' after reaching this station."); LoadParam(root, "opening-sound", this, MoverStation, setOpeningSoundFile) .describe("Sets the file of the opening sound source"); LoadParam(root, "opened-sound", this, MoverStation, setOpenedSoundFile) .describe("Sets the file of the opened sound source"); LoadParam(root, "moving-sound", this, MoverStation, setMovingSoundFile) .describe("Sets the file of the moving sound source"); LoadParam(root, "closing-sound", this, MoverStation, setClosingSoundFile) .describe("Sets the file of the closing sound source"); LoadParam(root, "closed-sound", this, MoverStation, setClosedSoundFile) .describe("Sets the file of the closed sound source"); if (this->bMoveToRank) { this->relTargetCoor = Vector(0, 0, 0); this->relTargetDir = Quaternion(0, Vector(0, 0, 0)); } }