Tous les scenarii.
This commit is contained in:
parent
4287ddf6d8
commit
afdc5811c7
@ -1,5 +1,7 @@
|
||||
package Cases;
|
||||
|
||||
import Cases.utils.Coordonnees;
|
||||
import Cases.utils.PointsCardinaux;
|
||||
import Objets.ObjetAbstrait;
|
||||
import Person.Personnage;
|
||||
|
||||
@ -86,7 +88,9 @@ public abstract class CaseAbstraite {
|
||||
this.voisins = voisins;
|
||||
}
|
||||
|
||||
public abstract String affichageSpecial();
|
||||
public String affichageSpecial() {
|
||||
return " ";
|
||||
}
|
||||
|
||||
public Coordonnees getCoord() {
|
||||
return coord;
|
||||
|
@ -10,7 +10,6 @@ public class CaseColore extends CaseAbstraite {
|
||||
this.couleur = Color.WHITE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String affichageSpecial() {
|
||||
if (this.couleur.getRGB() < 0)
|
||||
return String.valueOf(String.valueOf(this.couleur.getRGB()).charAt(0));
|
||||
|
7
src/Cases/CaseNeige.java
Normal file
7
src/Cases/CaseNeige.java
Normal file
@ -0,0 +1,7 @@
|
||||
package Cases;
|
||||
|
||||
public class CaseNeige extends CaseAbstraite {
|
||||
public CaseNeige(int col, int ligne) {
|
||||
super(col, ligne);
|
||||
}
|
||||
}
|
7
src/Cases/CasePelouse.java
Normal file
7
src/Cases/CasePelouse.java
Normal file
@ -0,0 +1,7 @@
|
||||
package Cases;
|
||||
|
||||
public class CasePelouse extends CaseAbstraite {
|
||||
public CasePelouse(int vert, int hor) {
|
||||
super(vert, hor);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package Cases;
|
||||
package Cases.utils;
|
||||
|
||||
public class Coordonnees {
|
||||
private int col;
|
@ -1,4 +1,4 @@
|
||||
package Cases;
|
||||
package Cases.utils;
|
||||
|
||||
public enum PointsCardinaux {
|
||||
N,
|
@ -1,4 +1,4 @@
|
||||
package Cases;
|
||||
package Cases.utils;
|
||||
|
||||
import java.util.Random;
|
||||
|
21
src/Composition/EquipeDeFoot.java
Normal file
21
src/Composition/EquipeDeFoot.java
Normal file
@ -0,0 +1,21 @@
|
||||
package Composition;
|
||||
|
||||
import Person.Personnage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class EquipeDeFoot extends GroupeAbstrait {
|
||||
|
||||
public String nom;
|
||||
|
||||
public EquipeDeFoot(ArrayList<Personnage> list) {
|
||||
super(list);
|
||||
this.nom = "Equipe";
|
||||
}
|
||||
|
||||
public EquipeDeFoot(ArrayList<Personnage> list, String nom) {
|
||||
super(list);
|
||||
this.nom = nom;
|
||||
|
||||
}
|
||||
}
|
@ -1,11 +1,21 @@
|
||||
package Composition;
|
||||
|
||||
import Person.Personnage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class GroupeAbstrait extends PersonnagesAbstraits {
|
||||
ArrayList<PersonnagesAbstraits> list = new ArrayList<PersonnagesAbstraits>();
|
||||
ArrayList<Personnage> list = new ArrayList<Personnage>();
|
||||
|
||||
public GroupeAbstrait(ArrayList<PersonnagesAbstraits> list) {
|
||||
public GroupeAbstrait(ArrayList<Personnage> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public ArrayList<Personnage> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(ArrayList<Personnage> list) {
|
||||
this.list = list;
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,31 @@
|
||||
package Fabriques.Personnages;
|
||||
|
||||
import Cases.CaseAbstraite;
|
||||
import Comportements.ComportementAction;
|
||||
import Comportements.ComportementActionTirerBouleDeNeige;
|
||||
import Observateur.Organisation;
|
||||
import Person.Personnage;
|
||||
import Person.PersonnageBattleSnow;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class FabriquePersonnagesBattleSnow extends FabriquePersonnagesAbstraite {
|
||||
protected ComportementAction parDefaut = new ComportementActionTirerBouleDeNeige();
|
||||
|
||||
@Override
|
||||
public ArrayList<Personnage> CreerPersonages(Organisation o, CaseAbstraite[][] plateau) {
|
||||
return null;
|
||||
ArrayList<Personnage> list = new ArrayList<Personnage>();
|
||||
|
||||
PersonnageBattleSnow p1 = new PersonnageBattleSnow("Bob", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
list.add(p1);
|
||||
PersonnageBattleSnow p2 = new PersonnageBattleSnow("Jo", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
list.add(p2);
|
||||
PersonnageBattleSnow p3 = new PersonnageBattleSnow("Max", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
list.add(p3);
|
||||
PersonnageBattleSnow p4 = new PersonnageBattleSnow("Zac", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
list.add(p4);
|
||||
|
||||
this.placement(list, plateau);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
@ -18,12 +18,12 @@ public class FabriquePersonnagesBattleZone extends FabriquePersonnagesAbstraite
|
||||
|
||||
PersonnageBattleZone p1 = new PersonnageBattleZone("Bob", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
list.add(p1);
|
||||
//PersonnageBattleZone p2 = new PersonnageBattleZone("Jo", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
//list.add(p2);
|
||||
//PersonnageBattleZone p3 = new PersonnageBattleZone("Max", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
//list.add(p3);
|
||||
//PersonnageBattleZone p4 = new PersonnageBattleZone("Zac", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
//list.add(p4);
|
||||
PersonnageBattleZone p2 = new PersonnageBattleZone("Jo", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
list.add(p2);
|
||||
PersonnageBattleZone p3 = new PersonnageBattleZone("Max", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
list.add(p3);
|
||||
PersonnageBattleZone p4 = new PersonnageBattleZone("Zac", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
list.add(p4);
|
||||
|
||||
this.placement(list, plateau);
|
||||
return list;
|
||||
|
@ -3,8 +3,11 @@ package Fabriques.Personnages;
|
||||
import Cases.CaseAbstraite;
|
||||
import Comportements.ComportementAction;
|
||||
import Comportements.ComportementActionTirerBalon;
|
||||
import Composition.EquipeDeFoot;
|
||||
import Composition.PersonnagesAbstraits;
|
||||
import Observateur.Organisation;
|
||||
import Person.Personnage;
|
||||
import Person.PersonnageFootball;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ -13,27 +16,32 @@ public class FabriquePersonnagesFootball extends FabriquePersonnagesAbstraite {
|
||||
|
||||
@Override
|
||||
public ArrayList<Personnage> CreerPersonages(Organisation o, CaseAbstraite[][] plateau) {
|
||||
ArrayList<Personnage> list = new ArrayList<Personnage>();
|
||||
|
||||
// TODO: Add players to team 1
|
||||
PersonnageFootball p1 = new PersonnageFootball("Bob", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
list.add(p1);
|
||||
PersonnageFootball p2 = new PersonnageFootball("Jo", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
list.add(p2);
|
||||
PersonnageFootball p3 = new PersonnageFootball("Max", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
list.add(p3);
|
||||
PersonnageFootball p4 = new PersonnageFootball("Zac", 100.0, 1.0, 1.0, 2, parDefaut);
|
||||
list.add(p4);
|
||||
|
||||
ArrayList<Personnage> l1 = (ArrayList<Personnage>) list.subList(0, 2);
|
||||
ArrayList<Personnage> l2 = (ArrayList<Personnage>) list.subList(2, 4);
|
||||
EquipeDeFoot e1 = new EquipeDeFoot(l1, "E1");
|
||||
EquipeDeFoot e2 = new EquipeDeFoot(l2, "E2");
|
||||
|
||||
// TODO: Add team 2
|
||||
for (PersonnagesAbstraits p : e1.getList()) {
|
||||
PersonnageFootball pf = (PersonnageFootball) p;
|
||||
pf.setEquipe(e1);
|
||||
}
|
||||
|
||||
// TODO: Add players to team 2
|
||||
for (PersonnagesAbstraits p : e2.getList()) {
|
||||
PersonnageFootball pf = (PersonnageFootball) p;
|
||||
pf.setEquipe(e2);
|
||||
}
|
||||
|
||||
/*
|
||||
Princesse p = new Princesse("Fiona");
|
||||
Chevalier z = new Chevalier(o, "Zodiac");
|
||||
Fantasssin f = new Fantasssin(o, "Fantastic");
|
||||
|
||||
ArrayList<Personnage> liste = new ArrayList<Personnage>();
|
||||
liste.add(p);
|
||||
liste.add(z);
|
||||
liste.add(f);
|
||||
return liste;
|
||||
*/
|
||||
|
||||
// TODO: Return two teams containg all players
|
||||
return null;
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,25 @@
|
||||
package Fabriques.Plateau;
|
||||
|
||||
import Cases.CaseAbstraite;
|
||||
import Cases.CaseNeige;
|
||||
import utils.Constants;
|
||||
|
||||
public class FabriquePlateauBattleSnow extends FabriquePlateauAbstraite {
|
||||
|
||||
@Override
|
||||
public CaseAbstraite[][] CreerPlateau() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
CaseAbstraite[][] plateau = new CaseAbstraite[Constants.TABLE_WIDTH][Constants.TABLE_HEIGHT];
|
||||
for (int ligne = 0; ligne < 10; ligne++) {
|
||||
for (int col = 0; col < 10; col++) {
|
||||
plateau[ligne][col] = new CaseNeige(col, ligne);
|
||||
}
|
||||
}
|
||||
for (CaseAbstraite[] tabC : plateau) {
|
||||
for (CaseAbstraite c : tabC) {
|
||||
c.generateVoisins(plateau);
|
||||
}
|
||||
}
|
||||
return plateau;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,13 +1,25 @@
|
||||
package Fabriques.Plateau;
|
||||
|
||||
import Cases.CaseAbstraite;
|
||||
import Cases.CasePelouse;
|
||||
import utils.Constants;
|
||||
|
||||
public class FabriquePlateauFootball extends FabriquePlateauAbstraite {
|
||||
|
||||
@Override
|
||||
public CaseAbstraite[][] CreerPlateau() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
CaseAbstraite[][] plateau = new CaseAbstraite[Constants.TABLE_WIDTH][Constants.TABLE_HEIGHT];
|
||||
for (int ligne = 0; ligne < 10; ligne++) {
|
||||
for (int col = 0; col < 10; col++) {
|
||||
plateau[ligne][col] = new CasePelouse(col, ligne);
|
||||
}
|
||||
}
|
||||
for (CaseAbstraite[] tabC : plateau) {
|
||||
for (CaseAbstraite c : tabC) {
|
||||
c.generateVoisins(plateau);
|
||||
}
|
||||
}
|
||||
return plateau;
|
||||
}
|
||||
|
||||
}
|
||||
|
17
src/Fabriques/Scenario/FabriqueScenarioFootball.java
Normal file
17
src/Fabriques/Scenario/FabriqueScenarioFootball.java
Normal file
@ -0,0 +1,17 @@
|
||||
package Fabriques.Scenario;
|
||||
|
||||
import Cases.CaseAbstraite;
|
||||
import Fabriques.Objets.FabriqueObjetFootball;
|
||||
import Fabriques.Personnages.FabriquePersonnagesFootball;
|
||||
import Fabriques.Plateau.FabriquePlateauFootball;
|
||||
|
||||
public class FabriqueScenarioFootball extends FabriqueScenarioAbstraite {
|
||||
public FabriqueScenarioFootball(FabriquePlateauFootball pl, FabriquePersonnagesFootball pr, FabriqueObjetFootball fObjs) {
|
||||
super(pl, pr, fObjs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tourParTour(CaseAbstraite[][] plateau) {
|
||||
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package Person;
|
||||
|
||||
import Cases.CaseAbstraite;
|
||||
import Cases.PointsCardinaux;
|
||||
import Cases.utils.PointsCardinaux;
|
||||
import Comportements.*;
|
||||
import Composition.PersonnagesAbstraits;
|
||||
import Etats.EEtat;
|
||||
|
@ -1,12 +0,0 @@
|
||||
package Person;
|
||||
|
||||
import Comportements.ComportementAction;
|
||||
|
||||
public class PersonnageBattleGoal extends Personnage {
|
||||
|
||||
protected PersonnageBattleGoal(String name, double lifePoint, double strength, double speed, int portee, ComportementAction parDefaut) {
|
||||
super(name, lifePoint, strength, speed, portee, parDefaut);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
}
|
@ -4,7 +4,7 @@ import Comportements.ComportementAction;
|
||||
|
||||
public class PersonnageBattleSnow extends Personnage{
|
||||
|
||||
protected PersonnageBattleSnow(String name, double lifePoint, double strength, double speed, int portee, ComportementAction parDefaut) {
|
||||
public PersonnageBattleSnow(String name, double lifePoint, double strength, double speed, int portee, ComportementAction parDefaut) {
|
||||
super(name, lifePoint, strength, speed, portee, parDefaut);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
25
src/Person/PersonnageFootball.java
Normal file
25
src/Person/PersonnageFootball.java
Normal file
@ -0,0 +1,25 @@
|
||||
package Person;
|
||||
|
||||
import Comportements.ComportementAction;
|
||||
import Composition.EquipeDeFoot;
|
||||
import Composition.GroupeAbstrait;
|
||||
|
||||
public class PersonnageFootball extends Personnage {
|
||||
|
||||
public EquipeDeFoot equipe;
|
||||
|
||||
public PersonnageFootball(String name, double lifePoint, double strength, double speed, int portee, ComportementAction parDefaut) {
|
||||
super(name, lifePoint, strength, speed, portee, parDefaut);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
||||
public GroupeAbstrait getEquipe() {
|
||||
return equipe;
|
||||
}
|
||||
|
||||
public void setEquipe(EquipeDeFoot equipe) {
|
||||
this.equipe = equipe;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user