Source

pyGAP / game / src / input / command_manager.cpp

Full commit
#include "input/command_manager.h"
#include "input/command.h"


namespace input {


CommandManager::CommandManager(int num_commands):
    num_commands_(num_commands),
    commands_(new Command[num_commands_])
{}


CommandManager::~CommandManager()
{
    num_commands_ = 0;
    delete [] commands_;
}

/*
void CommandManager::set_num_commands(int num_commands)
{
    num_commands_ = num_commands;
    commands_ = new Command[num_commands];
}
*/

void CommandManager::update()
{
    for (int i = 0; i < num_commands_; i++)
        commands_[i].update_input();
}


Command& CommandManager::operator [] (int index)
{
    return commands_[index];
}


Command& CommandManager::operator [] (int index) const
{
    return commands_[index];
}


} // namespace input