-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from EntelectChallenge/develop
Develop
- Loading branch information
Showing
109 changed files
with
3,207 additions
and
414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
public interface GameEngine { | ||
|
||
boolean isGameComplete(GameMap gameMap); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 15 additions & 6 deletions
21
game-engine/core/src/main/java/za/co/entelect/challenge/core/entities/GameDetails.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,33 @@ | ||
package za.co.entelect.challenge.core.entities; | ||
|
||
import za.co.entelect.challenge.config.GameConfig; | ||
import za.co.entelect.challenge.entities.BuildingStats; | ||
import za.co.entelect.challenge.enums.BuildingType; | ||
import za.co.entelect.challenge.factories.BuildingFactory; | ||
|
||
import java.util.Arrays; | ||
import java.util.HashMap; | ||
|
||
public class GameDetails { | ||
|
||
private int round; | ||
private int mapWidth; | ||
private int mapHeight; | ||
private HashMap<BuildingType, Integer> buildingPrices; | ||
private int roundIncomeEnergy; | ||
|
||
@Deprecated | ||
private HashMap<BuildingType, Integer> buildingPrices = new HashMap<>(); | ||
|
||
public GameDetails(int round){ | ||
private HashMap<BuildingType, BuildingStats> buildingsStats = new HashMap<>(); | ||
|
||
public GameDetails(int round) { | ||
this.round = round; | ||
this.mapWidth = GameConfig.getMapWidth(); | ||
this.mapHeight = GameConfig.getMapHeight(); | ||
this.roundIncomeEnergy = GameConfig.getRoundIncomeEnergy(); | ||
|
||
Arrays.asList(BuildingType.values()).forEach(bt -> buildingPrices.put(bt, BuildingFactory.createBuildingStats(bt).price)); | ||
|
||
buildingPrices = new HashMap<>(); | ||
buildingPrices.put(BuildingType.DEFENSE, GameConfig.getDefensePrice()); | ||
buildingPrices.put(BuildingType.ATTACK, GameConfig.getAttackPrice()); | ||
buildingPrices.put(BuildingType.ENERGY, GameConfig.getEnergyPrice()); | ||
Arrays.stream(BuildingType.values()).forEach(bt -> buildingsStats.put(bt, BuildingFactory.createBuildingStats(bt))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
game-engine/core/src/main/java/za/co/entelect/challenge/core/state/RoundState.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
game-engine/domain/src/main/java/za/co/entelect/challenge/entities/BuildingStats.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package za.co.entelect.challenge.entities; | ||
|
||
public class BuildingStats { | ||
|
||
public int health; | ||
public int constructionTime; | ||
public int price; | ||
public int weaponDamage; | ||
public int weaponSpeed; | ||
public int weaponCooldownPeriod; | ||
public int energyGeneratedPerTurn; | ||
public int destroyMultiplier; | ||
public int constructionScore; | ||
|
||
public BuildingStats(Building building) { | ||
this.health = building.getHealth(); | ||
this.constructionTime = building.getConstructionTimeLeft(); | ||
this.price = building.getPrice(); | ||
this.weaponDamage = building.getWeaponDamage(); | ||
this.weaponSpeed = building.getWeaponSpeed(); | ||
this.weaponCooldownPeriod = building.getWeaponCooldownPeriod(); | ||
this.destroyMultiplier = building.getDestroyMultiplier(); | ||
this.constructionScore = building.getConstructionScore(); | ||
this.energyGeneratedPerTurn = building.getEnergyGeneratedPerTurn(); | ||
} | ||
|
||
public static String getTextHeader() { | ||
return "health;constructionTime;price;weaponDamage;weaponSpeed;weaponCooldownPeriod;energyGeneratedPerTurn;destroyMultiplier;constructionScore"; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return health + ";" + | ||
constructionTime + ";" + | ||
price + ";" + | ||
weaponDamage + ";" + | ||
weaponSpeed + ";" + | ||
weaponCooldownPeriod + ";" + | ||
energyGeneratedPerTurn + ";" + | ||
destroyMultiplier + ";" + | ||
constructionScore + ";"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
{ | ||
"round-state-output-location": "./tower-defence-matches", | ||
"game-config-file-location": "./game-config.properties", | ||
"verbose-mode": true, | ||
"max-runtime-ms": 2000, | ||
"player-a": "../starter-bots/kotlin", | ||
"player-b": "../starter-bots/python3" | ||
"player-a": "../starter-bots/java", | ||
"player-b": "../reference-bot/java" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#Game Config | ||
game.config.map-width = 8 | ||
game.config.map-height = 4 | ||
game.config.max-rounds = 400 | ||
game.config.start-energy = 20 | ||
game.config.round-income-energy = 5 | ||
game.config.starting-health = 100 | ||
game.config.health-score-multiplier = 100 | ||
game.config.energy-score-multiplier = 1 | ||
|
||
#Basic Wall Config | ||
game.config.defense.config.health = 20 | ||
game.config.defense.config.construction-time-left = 3 | ||
game.config.defense.config.price = 30 | ||
game.config.defense.config.weapon-damage = 0 | ||
game.config.defense.config.weapon-speed = 0 | ||
game.config.defense.config.weapon-cooldown-period = 0 | ||
game.config.defense.config.icon = D | ||
game.config.defense.config.destroy-multiplier = 1 | ||
game.config.defense.config.construction-score = 1 | ||
game.config.defense.config.energy-Produced-per-turn = 0 | ||
|
||
#Basic Turret Config | ||
game.config.attack.config.health = 5 | ||
game.config.attack.config.construction-time-left = 1 | ||
game.config.attack.config.price = 30 | ||
game.config.attack.config.weapon-damage = 5 | ||
game.config.attack.config.weapon-speed = 1 | ||
game.config.attack.config.weapon-cooldown-period = 3 | ||
game.config.attack.config.icon = A | ||
game.config.attack.config.destroy-multiplier = 1 | ||
game.config.attack.config.construction-score = 1 | ||
game.config.attack.config.energy-Produced-per-turn = 0 | ||
|
||
#Basic Energy Generator Config | ||
game.config.energy.config.health = 5 | ||
game.config.energy.config.construction-time-left = 1 | ||
game.config.energy.config.price = 20 | ||
game.config.energy.config.weapon-damage = 0 | ||
game.config.energy.config.weapon-speed = 0 | ||
game.config.energy.config.weapon-cooldown-period = 0 | ||
game.config.energy.config.icon = E | ||
game.config.energy.config.destroy-multiplier = 1 | ||
game.config.energy.config.construction-score = 1 | ||
game.config.energy.config.energy-Produced-per-turn = 3 |
Oops, something went wrong.