Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/core/ConsoleCommand.cc @ 1504

Last change on this file since 1504 was 1504, checked in by rgrieder, 17 years ago

Once again, set all the svn:eol-style property to native. I really hope this doesn't pose more problems than it solves..

  • Property eol-style set to native
File size: 2.6 KB
RevLine 
[1390]1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Fabian 'x3n' Landau
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#include "ConsoleCommand.h"
30
31namespace orxonox
32{
33    ConsoleCommand::ConsoleCommand(FunctorStatic* functor, const std::string& name) : ExecutorStatic(functor, name)
34    {
35        this->accessLevel_ = AccessLevel::None;
[1430]36        this->argumentCompleter_[0] = 0;
37        this->argumentCompleter_[1] = 0;
38        this->argumentCompleter_[2] = 0;
39        this->argumentCompleter_[3] = 0;
40        this->argumentCompleter_[4] = 0;
[1446]41
42        this->keybindMode_ = KeybindMode::OnPress;
43        this->axisParamIndex_ = -1;
44        this->bAxisRelative_ = false;
[1390]45    }
46
[1434]47    ConsoleCommand& ConsoleCommand::setArgumentCompleter(unsigned int param, ArgumentCompleter* completer)
[1390]48    {
[1402]49        if (param < 5)
[1430]50            this->argumentCompleter_[param] = completer;
[1390]51        else
52        {
53            COUT(2) << "Warning: Couldn't add autocompletion-function for param " << param << ": index out of bound." << std::endl;
54        }
55        return (*this);
56    }
57
[1434]58    ArgumentCompleter* ConsoleCommand::getArgumentCompleter(unsigned int param) const
59    {
60        if (param < 5)
61            return this->argumentCompleter_[param];
62        else
63            return 0;
64    }
65
[1430]66    void ConsoleCommand::createArgumentCompletionList(unsigned int param, const std::string& param1, const std::string& param2, const std::string& param3, const std::string& param4, const std::string& param5)
[1390]67    {
[1430]68        if (param < 5 && this->argumentCompleter_[param])
69            this->argumentList_ = (*this->argumentCompleter_[param])(param1, param2, param3, param4, param5);
[1390]70        else
[1430]71            this->argumentList_.clear();
[1390]72    }
73}
Note: See TracBrowser for help on using the repository browser.