Des bouts de code faits ... ouais
This commit is contained in:
parent
26755f9ecd
commit
6bc9d4df9d
26
src/main/java/com/bernard/greposimu/model/game/Building.java
Normal file
26
src/main/java/com/bernard/greposimu/model/game/Building.java
Normal file
@ -0,0 +1,26 @@
|
||||
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;
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package com.bernard.greposimu.model.runtime;
|
||||
|
||||
public class Alliance {
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package com.bernard.greposimu.model.runtime;
|
||||
|
||||
public class Joueureuse {
|
||||
|
||||
String nom;
|
||||
Alliance alliance;
|
||||
int points;
|
||||
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package com.bernard.greposimu.model.runtime;
|
||||
|
||||
public class PositionVille {
|
||||
|
||||
int ileId;
|
||||
int x,y,nr,ex,ey,fx,fy;
|
||||
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.bernard.greposimu.model.runtime;
|
||||
|
||||
public class Timestamp {
|
||||
|
||||
long timestamp;
|
||||
|
||||
}
|
||||
18
src/main/java/com/bernard/greposimu/model/runtime/Ville.java
Normal file
18
src/main/java/com/bernard/greposimu/model/runtime/Ville.java
Normal file
@ -0,0 +1,18 @@
|
||||
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
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
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
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package com.bernard.greposimu.model.simulator;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class Troupes {
|
||||
|
||||
Map<String,Integer> unites;
|
||||
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
11
src/main/resources/greposource.js
Normal file
11
src/main/resources/greposource.js
Normal file
@ -0,0 +1,11 @@
|
||||
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)
|
||||
Loading…
x
Reference in New Issue
Block a user