-added possibility for tester to take control of the test suite
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-08-25 11:55:07 +00:00
parent 0454d39f79
commit fb0dccb7f3
4 changed files with 25 additions and 7 deletions

View File

@@ -43,12 +43,8 @@ void DuelLayers::init(){
Add(NEW GuiBackground());
}
void DuelLayers::Update(float dt, Player * currentPlayer)
{
for (int i = 0; i < nbitems; ++i) objects[i]->Update(dt);
int isAI = currentPlayer->isAI();
void DuelLayers::CheckUserInput(int isAI){
u32 key;
GameObserver * game = GameObserver::GetInstance();
while ((key = JGE::GetInstance()->ReadButton())){
if ((!isAI) && (0 != key))
{
@@ -59,7 +55,16 @@ void DuelLayers::Update(float dt, Player * currentPlayer)
if (cs->CheckUserInput(key)) break;
}
}
}
void DuelLayers::Update(float dt, Player * currentPlayer)
{
for (int i = 0; i < nbitems; ++i) objects[i]->Update(dt);
int isAI = currentPlayer->isAI();
GameObserver * game = GameObserver::GetInstance();
if (isAI) currentPlayer->Act(dt);
CheckUserInput(isAI);
}
ActionStack * DuelLayers::stackLayer(){