/* 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: Benjamin Grauer co-programmer: ... */ //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ #include "executor.h" //////////////////////// // SHELL COMMAND BASE // //////////////////////// /** * @brief constructs and registers a new Command * @param commandName the name of the Command * @param className the name of the class to apply this command to * @param paramCount the count of parameters this command takes */ Executor::Executor(const MultiType& param0, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5, const MultiType& param6) { this->setClassID(CL_EXECUTOR, "Executor"); // What Parameters have we got this->defaultValue[0] = param0; this->defaultValue[1] = param1; this->defaultValue[2] = param2; this->defaultValue[3] = param3; this->defaultValue[4] = param4; this->defaultValue[5] = param5; this->defaultValue[6] = param6; this->paramCount = 0; for (unsigned int i = 0; i <= FUNCTOR_MAX_ARGUMENTS; i++) { if (this->defaultValue[i] == MT_NULL || i == FUNCTOR_MAX_ARGUMENTS) { this->paramCount = i; break; } } } /** * deconstructs a Executor */ Executor::~Executor() {} /** * clones this element into executor. */ void Executor::cloning(Executor* executor) const { executor->functorType = this->functorType; executor->paramCount = this->paramCount; for (unsigned int i = 0; i < this->paramCount; i++) executor->defaultValue[i] = this->defaultValue[i]; } /** * @brief set the default values of the executor * @param value0 the first default value * @param value1 the second default value * @param value2 the third default value * @param value3 the fourth default value * @param value4 the fifth default value * @returns itself */ Executor* Executor::defaultValues(const MultiType& value0, const MultiType& value1, const MultiType& value2, const MultiType& value3, const MultiType& value4, const MultiType& value5, const MultiType& value6) { if (this == NULL) return NULL; const MultiType* value[5]; value[0] = &value0; value[1] = &value1; value[2] = &value2; value[3] = &value3; value[4] = &value4; value[5] = &value5; value[6] = &value6; for (unsigned int i = 0; i < this->paramCount; i++) { if (*value[i] != MT_NULL) { this->defaultValue[i].setValueOf(*value[i]); } } return this; } /** * @brief prints out nice information about the Executor */ void Executor::debug() { }