Moved the different table draft formats to separate package; WeightDraftBot now properly works with missing card values

This commit is contained in:
jakub.salavec
2025-03-12 10:33:51 +01:00
parent 70476f1bf5
commit 4d95f6ee13
14 changed files with 23 additions and 24 deletions

View File

@@ -1,10 +1,10 @@
package com.gempukku.lotro.draft3;
import com.gempukku.lotro.collection.CollectionsManager;
import com.gempukku.lotro.draft3.fotr.FotrTableDraftDefinition;
import com.gempukku.lotro.draft3.fotr_mixed.FotrMixedTableDraftDefinition;
import com.gempukku.lotro.draft3.ttt.TttTableDraftDefinition;
import com.gempukku.lotro.draft3.ttt_mixed.TttMixedTableDraftDefinition;
import com.gempukku.lotro.draft3.format.fotr.FotrTableDraftDefinition;
import com.gempukku.lotro.draft3.format.fotr_mixed.FotrMixedTableDraftDefinition;
import com.gempukku.lotro.draft3.format.ttt.TttTableDraftDefinition;
import com.gempukku.lotro.draft3.format.ttt_mixed.TttMixedTableDraftDefinition;
import com.gempukku.lotro.game.LotroCardBlueprintLibrary;
import com.gempukku.lotro.game.formats.LotroFormatLibrary;

View File

@@ -48,7 +48,7 @@ public class WeightDraftBot extends DraftPlayer implements DraftBot {
private double getTotalValue(List<String> topCards) {
// Sum up the values of the top N cards
return topCards.stream()
.mapToDouble(cardId -> cardValues.getOrDefault(cardId, 0.0))
.mapToDouble(cardId -> cardValues.getOrDefault(cardId, 0.1))
.sum();
}

View File

@@ -1,4 +1,4 @@
package com.gempukku.lotro.draft3.fotr;
package com.gempukku.lotro.draft3.format.fotr;
import com.gempukku.lotro.common.AppConfig;
import com.gempukku.lotro.common.Side;

View File

@@ -1,4 +1,4 @@
package com.gempukku.lotro.draft3.fotr;
package com.gempukku.lotro.draft3.format.fotr;
import com.gempukku.lotro.collection.CollectionsManager;
import com.gempukku.lotro.draft3.Booster;

View File

@@ -1,11 +1,10 @@
package com.gempukku.lotro.draft3.fotr;
package com.gempukku.lotro.draft3.format.fotr;
import com.gempukku.lotro.collection.CollectionsManager;
import com.gempukku.lotro.db.vo.CollectionType;
import com.gempukku.lotro.draft3.*;
import com.gempukku.lotro.draft3.timer.DraftTimer;
import com.gempukku.lotro.draft3.timer.DraftTimerProducer;
import com.gempukku.lotro.game.CardNotFoundException;
import com.gempukku.lotro.game.LotroCardBlueprintLibrary;
import com.gempukku.lotro.game.formats.LotroFormatLibrary;

View File

@@ -1,4 +1,4 @@
package com.gempukku.lotro.draft3.fotr;
package com.gempukku.lotro.draft3.format.fotr;
import com.gempukku.lotro.collection.CollectionsManager;
import com.gempukku.lotro.draft3.StartingCollectionProducer;
@@ -39,7 +39,7 @@ public class FotrTableDraftStartingCollectionProducer implements StartingCollect
@Override
public MutableCardCollection getStartingCardCollection(String uniqueEventName, String playerName) {
long seed = uniqueEventName.hashCode() + (long) playerName.hashCode() * HIGH_ENOUGH_PRIME_NUMBER;
long seed = uniqueEventName.hashCode() + (long) playerName.hashCode() * HIGH_ENOUGH_PRIME_NUMBER;
Random rnd = new Random(seed);
final DefaultCardCollection startingCollection = new DefaultCardCollection();

View File

@@ -1,4 +1,4 @@
package com.gempukku.lotro.draft3.fotr_mixed;
package com.gempukku.lotro.draft3.format.fotr_mixed;
import com.gempukku.lotro.collection.CollectionsManager;
import com.gempukku.lotro.draft3.Booster;

View File

@@ -1,10 +1,10 @@
package com.gempukku.lotro.draft3.fotr_mixed;
package com.gempukku.lotro.draft3.format.fotr_mixed;
import com.gempukku.lotro.collection.CollectionsManager;
import com.gempukku.lotro.db.vo.CollectionType;
import com.gempukku.lotro.draft3.*;
import com.gempukku.lotro.draft3.fotr.FotrDraftCardEvaluator;
import com.gempukku.lotro.draft3.fotr.FotrTableDraftStartingCollectionProducer;
import com.gempukku.lotro.draft3.format.fotr.FotrDraftCardEvaluator;
import com.gempukku.lotro.draft3.format.fotr.FotrTableDraftStartingCollectionProducer;
import com.gempukku.lotro.draft3.timer.DraftTimer;
import com.gempukku.lotro.draft3.timer.DraftTimerProducer;
import com.gempukku.lotro.game.LotroCardBlueprintLibrary;

View File

@@ -1,4 +1,4 @@
package com.gempukku.lotro.draft3.ttt;
package com.gempukku.lotro.draft3.format.ttt;
import com.gempukku.lotro.common.AppConfig;
import com.gempukku.lotro.common.Side;

View File

@@ -1,4 +1,4 @@
package com.gempukku.lotro.draft3.ttt;
package com.gempukku.lotro.draft3.format.ttt;
import com.gempukku.lotro.collection.CollectionsManager;
import com.gempukku.lotro.draft3.Booster;

View File

@@ -1,4 +1,4 @@
package com.gempukku.lotro.draft3.ttt;
package com.gempukku.lotro.draft3.format.ttt;
import com.gempukku.lotro.collection.CollectionsManager;
import com.gempukku.lotro.db.vo.CollectionType;

View File

@@ -1,4 +1,4 @@
package com.gempukku.lotro.draft3.ttt;
package com.gempukku.lotro.draft3.format.ttt;
import com.gempukku.lotro.collection.CollectionsManager;
import com.gempukku.lotro.draft3.StartingCollectionProducer;
@@ -40,7 +40,7 @@ public class TttTableDraftStartingCollectionProducer implements StartingCollecti
@Override
public MutableCardCollection getStartingCardCollection(String uniqueEventName, String playerName) {
long seed = uniqueEventName.hashCode() + (long) playerName.hashCode() * HIGH_ENOUGH_PRIME_NUMBER;
long seed = uniqueEventName.hashCode() + (long) playerName.hashCode() * HIGH_ENOUGH_PRIME_NUMBER;
Random rnd = new Random(seed);
final DefaultCardCollection startingCollection = new DefaultCardCollection();

View File

@@ -1,4 +1,4 @@
package com.gempukku.lotro.draft3.ttt_mixed;
package com.gempukku.lotro.draft3.format.ttt_mixed;
import com.gempukku.lotro.collection.CollectionsManager;
import com.gempukku.lotro.draft3.Booster;

View File

@@ -1,12 +1,12 @@
package com.gempukku.lotro.draft3.ttt_mixed;
package com.gempukku.lotro.draft3.format.ttt_mixed;
import com.gempukku.lotro.collection.CollectionsManager;
import com.gempukku.lotro.db.vo.CollectionType;
import com.gempukku.lotro.draft3.*;
import com.gempukku.lotro.draft3.timer.DraftTimer;
import com.gempukku.lotro.draft3.timer.DraftTimerProducer;
import com.gempukku.lotro.draft3.ttt.TttDraftCardEvaluator;
import com.gempukku.lotro.draft3.ttt.TttTableDraftStartingCollectionProducer;
import com.gempukku.lotro.draft3.format.ttt.TttDraftCardEvaluator;
import com.gempukku.lotro.draft3.format.ttt.TttTableDraftStartingCollectionProducer;
import com.gempukku.lotro.game.LotroCardBlueprintLibrary;
import com.gempukku.lotro.game.formats.LotroFormatLibrary;