Commits

Anonymous committed f57652d Draft

bug fix (mixing injection with constructor)

Comments (0)

Files changed (2)

game/src/main/java/com/cubeia/firebase/script/game/DefaultScriptSupport.java

 import com.cubeia.firebase.api.game.context.GameContext;
 import com.cubeia.firebase.api.game.table.InterceptionResponse;
 import com.cubeia.firebase.api.game.table.Table;
-import com.cubeia.firebase.guice.inject.Log4j;
 import com.cubeia.firebase.script.api.ScriptSupport;
 import com.cubeia.firebase.script.service.api.Evaluator;
-import com.google.inject.Inject;
 
 public class DefaultScriptSupport implements ScriptSupport {
 
 	private static final String UTF8 = "UTF-8";
 
-	@Log4j
-	private Logger log;
+	private Logger log = Logger.getLogger(getClass());
 	
-	@Inject
-	private GameContext con;
-
+	private final GameContext con;
 	private final Evaluator eval;
 	
-	public DefaultScriptSupport(Evaluator eval) {
+	public DefaultScriptSupport(Evaluator eval, GameContext con) {
 		this.eval = eval;
+		this.con = con;
 	}
 	
 	@Override

game/src/main/java/com/cubeia/firebase/script/game/Processor.java

 import com.cubeia.firebase.api.action.GameObjectAction;
 import com.cubeia.firebase.api.game.GameProcessor;
 import com.cubeia.firebase.api.game.TournamentProcessor;
+import com.cubeia.firebase.api.game.context.GameContext;
 import com.cubeia.firebase.api.game.player.GenericPlayer;
 import com.cubeia.firebase.api.game.player.PlayerStatus;
 import com.cubeia.firebase.api.game.table.InterceptionResponse;
 	@Log4j
 	private Logger log;
 	
+	@Inject
+	private GameContext con;
+	
 	
 	// --- TOURNAMENT PROCESSOR --- //
 	
 
 	private void prepare(Evaluator e, String method, Object...args) {
 		e.set(LOG, log);
-		e.set(HELPER, new DefaultScriptSupport(e));
+		e.set(HELPER, new DefaultScriptSupport(e, con));
 		e.set(METHOD, method);
 		e.set(ARGUMENTS, args);
 	}