mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Fixed NPE in monte carlo. Removed actions remembering for now as not used yet.
This commit is contained in:
parent
48f5a469d4
commit
cb929d1f21
2 changed files with 4 additions and 1 deletions
|
@ -40,6 +40,9 @@ public abstract class MageAction {
|
|||
* @return
|
||||
*/
|
||||
public int getScore(final Player player) {
|
||||
if (player == null || scorePlayer == null) {
|
||||
return 0;
|
||||
}
|
||||
if (player.getId().equals(scorePlayer.getId())) {
|
||||
return score;
|
||||
} else {
|
||||
|
|
|
@ -1359,7 +1359,7 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
|||
|
||||
@Override
|
||||
public int doAction(MageAction action) {
|
||||
actions.add(action);
|
||||
//actions.add(action);
|
||||
int value = action.doAction(this);
|
||||
score += action.getScore(scorePlayer);
|
||||
return value;
|
||||
|
|
Loading…
Reference in a new issue