/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 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: Patrick Boenzli */ #define DEBUG_MODULE_GAME_RULES #include "singleplayer_shootemup.h" #include "util/loading/load_param.h" #include "util/loading/factory.h" #include "mission_goal.h" #include "class_id_DEPRECATED.h" ObjectListDefinitionID(SingleplayerShootemup, CL_SINGLEPLAYER_SHOOTEMUP); CREATE_FACTORY(SingleplayerShootemup); /** * constructor */ SingleplayerShootemup::SingleplayerShootemup(const TiXmlElement* root) : GameRules(root) { this->registerObject(this, SingleplayerShootemup::_objectList); if( root != NULL) this->loadParams(root); } /** * decontsructor */ SingleplayerShootemup::~SingleplayerShootemup() { } void SingleplayerShootemup::loadParams(const TiXmlElement* root) { GameRules::loadParams(root) ; LoadParam(root, "death-screen-image", this, SingleplayerShootemup, setDeathScreen) .describe("sets the death screen image"); } void SingleplayerShootemup::setDeathScreen(const std::string& imageName) {} /** * called when the player enters the game * @param player the spawned player */ void SingleplayerShootemup::onPlayerSpawn() { } /** * when the player is killed * @param player the killed player */ void SingleplayerShootemup::onPlayerDeath() { } /** * time tick * @param dt time */ void SingleplayerShootemup::tick(float dt) { this->checkGameRules(dt); } /** * draws the stuff */ void SingleplayerShootemup::draw() {} /** * check the game rules for consistency */ void SingleplayerShootemup::checkGameRules(float dt) { // PRINTF(0)("===========| Printing Mission State:\n"); for (std::vector::iterator it = this->missionList.begin(); it != this->missionList.end(); it++) { if( (*it)->checkMissionGoal(dt) != MS_ACCOMPLISHED) { // PRINTF(0)(" Mission \"%s\" is not finished yet\n", (*it)->getMissionName().c_str()); } } }