
Untitled
By: a guest on
Apr 28th, 2012 | syntax:
None | size: 1.15 KB | hits: 17 | expires: Never
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.derpina.roma.backend.action.pyramid;
import com.derpina.roma.backend.choices.ChoiceFactory;
import com.derpina.roma.core.Choice;
import com.derpina.roma.core.GameState;
import java.util.ArrayList;
import java.util.Collection;
/**
*
* @author Lasath Fernando <edu@lasath.org>
* @author Matthew Moss
*/
abstract public class HipsterAction implements Action {
protected final GameState gameState;
private Collection<ChoiceFactory> children;
public HipsterAction(GameState gameState) {
this.gameState = gameState;
this.children = new ArrayList<ChoiceFactory>();
}
protected void registerFactory(ChoiceFactory f) {
children.add(f);
}
@Override
public Collection<Choice> getIntents() {
for (ChoiceFactory choiceFactory : children) {
if (!choiceFactory.isValueSet()) {
return choiceFactory.getChoices();
}
}
return new ArrayList<Choice>();
}
@Override
public void execute() {
}
}