Compare commits

..

No commits in common. "6bc9d4df9d2c843e94afaceef1e502c2e2091074" and "6e2f9169276fa0b2af4a74941decc04ed2561432" have entirely different histories.

12 changed files with 4 additions and 251 deletions

View File

@ -15,21 +15,6 @@ import com.bernard.greposimu.model.game.units.Unit;
public class Fight { public class Fight {
public FightResult simulateFight(GameConfig gc, OffContext off, DefContext def) {
FightStats offStats = computeOffStats(gc, off);
FightStats defStats = computeDefStats(gc, def);
// Combat Naval
if(offStats.getShip() > defStats.getShip()) {
// Off wins ship
} else {
}
//TODO simulateFight
throw new UnsupportedOperationException("Simulator not created");
}
public static FightStats computeDefStats(GameConfig gc, DefContext def) { public static FightStats computeDefStats(GameConfig gc, DefContext def) {
FightStats everyoneStatsBonus = FightStats.zero(); FightStats everyoneStatsBonus = FightStats.zero();
@ -232,11 +217,6 @@ public class Fight {
0.0 0.0
)); ));
} }
// Bonuses
everyoneStatsBonus = FightStats.add(everyoneStatsBonus, FightStats.cst(off.getLuck()/100.0));
everyoneStatsBonus = FightStats.add(everyoneStatsBonus, FightStats.cst(-(100.0-off.getMorale())/100.0));
return total; return total;
} }
@ -259,8 +239,10 @@ public class Fight {
return gc.getUnits().stream().toList(); return gc.getUnits().stream().toList();
} }
public FightResult simulateFight(OffContext off, DefContext def) {
//TODO simulateFight
throw new UnsupportedOperationException("Simulator not created");
}
public static class FightResult { public static class FightResult {

View File

@ -70,22 +70,6 @@ public class FightStats implements Cloneable{
return new FightStats(k * b.hack, k * b.pierce, k * b.distance, k * b.ship); return new FightStats(k * b.hack, k * b.pierce, k * b.distance, k * b.ship);
} }
public double getHack() {
return hack;
}
public double getPierce() {
return pierce;
}
public double getDistance() {
return distance;
}
public double getShip() {
return ship;
}
@Override @Override
public FightStats clone() { public FightStats clone() {
return new FightStats(hack, pierce, distance, ship); return new FightStats(hack, pierce, distance, ship);

View File

@ -1,26 +0,0 @@
package com.bernard.greposimu.model.game;
public enum Building {
AGORA,
SENAT,
SCIERIE,
FERME,
CARRIERE,
ENTREPOT,
MINE,
CASERNE,
TEMPLE,
MARCHE,
PORT,
ACADEMIE,
REMPARTS,
GROTTE,
THEATRE,
THERMES,
BIBLIOTHEQUE,
PHARE,
TOUR,
STATUE,
ORACLE,
COMPTOIR;
}

View File

@ -1,5 +0,0 @@
package com.bernard.greposimu.model.runtime;
public class Alliance {
}

View File

@ -1,9 +0,0 @@
package com.bernard.greposimu.model.runtime;
public class Joueureuse {
String nom;
Alliance alliance;
int points;
}

View File

@ -1,8 +0,0 @@
package com.bernard.greposimu.model.runtime;
public class PositionVille {
int ileId;
int x,y,nr,ex,ey,fx,fy;
}

View File

@ -1,7 +0,0 @@
package com.bernard.greposimu.model.runtime;
public class Timestamp {
long timestamp;
}

View File

@ -1,18 +0,0 @@
package com.bernard.greposimu.model.runtime;
import com.bernard.greposimu.model.game.Resources;
public class Ville {
int id;
// null -> Ville fantôme
Joueureuse proprietaire;
PositionVille ville;
Resources resources;
Map<String,Integer> batiments
}

View File

@ -1,32 +0,0 @@
package com.bernard.greposimu.model.simulator;
import java.util.List;
import java.util.Map;
import com.bernard.greposimu.model.game.God;
import com.bernard.greposimu.model.runtime.Timestamp;
public class Joueureuse {
// God
Map<God,Integer> favor;
int rage;
int gold;
// Heroes
// herosId -> townId
Map<String,Integer> heroes;
// herosId -> timeOfArrival
Map<String,Timestamp> heroesArrival;
// herosid -> level
Map<String,Integer> heroesLevel;
List<String> inventory;
//TODO quêtes
//TODO messages/rapports
//TODO profile
//TODO alliance + allianceMessages
}

View File

@ -1,9 +0,0 @@
package com.bernard.greposimu.model.simulator;
import java.util.Map;
public class Troupes {
Map<String,Integer> unites;
}

View File

@ -1,88 +0,0 @@
package com.bernard.greposimu.model.simulator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.bernard.greposimu.model.game.God;
import com.bernard.greposimu.model.game.Resources;
import com.bernard.greposimu.model.runtime.Timestamp;
public class Ville {
int id;
String nom;
Map<String,Integer> batiments;
Troupes troupes;
// origin town id -> troupes
Map<Integer,Troupes> soutiens;
// Destination town -> troupes
Map<Integer,Troupes> soutenus;
// sortilegeId -> effectEnd
Map<String,Timestamp> sortileges;
// Agora
Timestamp festivalEnd,olympiquesEnd,marchEnd,theaterEnd;
// Academie
Set<String> researches;
List<QueueItem> researchQueue;
// Senat
List<QueueItem> buildingQueue;
// Farm
Timestamp miliceAppel;
// Entrepôt
Resources storage;
// Caserne
List<QueueItem> terrestrialQueue;
// Temple
God god;
// Port
List<QueueItem> navalQueue;
// Remparts
Troupes slainAsOff,slainAsDef,lostAsOff,lostAsDef;
// Grotte
int piecesStoquees;
/* Ordres */
Set<UnitOrder> ordresMilitaires;
Set<TradeOrder> incomingTrade;
Set<TradeOrder> outgoingTrade;
public static class TradeOrder {
Resources resources;
Integer other;
}
public static class UnitOrder {
Troupes attq;
Timestamp arrivee;
OrderType type;
Set<String> sortileges;
}
public static enum OrderType {
ATTACK,
SUPPORT,
ATTACK_CANCELED,
ATTACK_RETURN;
}
public static class QueueItem {
String buildingId;
Timestamp startTime;
Timestamp endTime;
long duration;
}
}

View File

@ -1,11 +0,0 @@
out = {}
for(var townid in ITowns.towns) {
out[townid] = {}
out[townid].units = ITowns.towns[townid].units()
out[townid].support = ITowns.towns[townid].unitsSupport()
out[townid].outer = ITowns.towns[townid].unitsOuter()
out[townid].resources = ITowns.towns[townid].resources()
out[townid].buildings = ITowns.towns[townid].buildings().getBuildings()
out[townid].researches = ITowns.towns[townid].researches().attributes
}
var json = JSON.stringify(out)