diff --git a/Actors/Bishop.java b/Actors/Bishop.java index f6e86ff..da13a23 100644 --- a/Actors/Bishop.java +++ b/Actors/Bishop.java @@ -1,14 +1,96 @@ package Actors; -import Components.Event.MouseObserver; +import Terrain.Board; import Terrain.Cell; +import java.awt.*; +import java.util.ArrayList; + /** * Created by dimaer on 27/03/17. */ -public class Bishop extends Pawn { - public Bishop(Cell cell, Team.TEAMTYPE teamtype) { - super(cell,teamtype); +public class Bishop extends Piece { + /** + * + * Costruttore di Bishop + * @param cell cella iniziale + * @param teamtype tipo di squadra + */ + public Bishop(Cell cell, Team.TEAMTYPE teamtype,Board board) { + super(cell,teamtype,board); + + getSprite().setOrigin(new Point(-35,-135)); + Point position = new Point(getSprite().getOrigin().x + cell.getSprite().getCenter().x, + getSprite().getOrigin().y + cell.getSprite().getCenter().y); + getSprite().setPosition(position); + getSpriteOutline().setPosition(position); + setSprite(teamtype.toString(),"Bishop"); + setSpriteOutline(teamtype.toString(),"Bishop-outline"); + } + + @Override + public ArrayList getValidCells() { + + ArrayList cells = new ArrayList<>(); + + int currentColumn = getCurrentCell().getCoord().y; + int currentRow = getCurrentCell().getCoord().x; + + boolean breakCellUpRight = false; + boolean breakCellUpLeft = false; + boolean breakCellDownRight = false; + boolean breakCellDownLeft = false; + + for(int i = 1;i<8;i++) { + if (currentColumn + i < 8 && (currentRow - i) >= 0) { + if ((getBoard().getColumn(currentColumn + i).get(currentRow - i)).isEmpty() && !breakCellUpRight) + cells.add(getBoard().getColumn(currentColumn + i).get(currentRow - i)); + else { + if (!breakCellUpRight) { + cells.add(getBoard().getColumn(currentColumn + i).get(currentRow - i)); + breakCellUpRight = true; + } + + } + } + + if (currentColumn - i >= 0 && (currentRow - i) >= 0) { + if ((getBoard().getColumn(currentColumn - i).get(currentRow - i)).isEmpty() && !breakCellUpLeft) + cells.add(getBoard().getColumn(currentColumn - i).get(currentRow - i)); + else { + if (!breakCellUpLeft) { + cells.add(getBoard().getColumn(currentColumn - i).get(currentRow - i)); + breakCellUpLeft = true; + } + } + } + } + + for(int i = 1;i<8;i++){ + + if(currentColumn + i<8 && (currentRow +i)<8) { + if (getBoard().getColumn(currentColumn + i).get(currentRow + i).isEmpty() && !breakCellDownRight) + cells.add(getBoard().getColumn(currentColumn + i).get(currentRow + i)); + else { + if (!breakCellDownRight) { + cells.add(getBoard().getColumn(currentColumn + i).get(currentRow + i)); + breakCellDownRight = true; + } + + } + } + if(currentColumn - i>=0 && (currentRow + i)<8) { + if (getBoard().getColumn(currentColumn - i).get(currentRow + i).isEmpty() && !breakCellDownLeft) + cells.add(getBoard().getColumn(currentColumn - i).get(currentRow + i)); + else { + if (!breakCellDownLeft) { + cells.add(getBoard().getColumn(currentColumn - i).get(currentRow + i)); + breakCellDownLeft = true; + } + } + } + } + return cells; } } diff --git a/Actors/King.java b/Actors/King.java index 40d0922..5f9d2e8 100644 --- a/Actors/King.java +++ b/Actors/King.java @@ -1,14 +1,65 @@ package Actors; +import Terrain.Board; import Terrain.Cell; import java.awt.*; +import java.util.ArrayList; /** * Created by dimaer on 27/03/17. */ -public class King extends Pawn { - public King(Cell cell, Team.TEAMTYPE teamtype) { - super(cell,teamtype); +public class King extends Piece { + /** + * + * Costruttore di King + * @param cell cella iniziale + * @param teamtype tipo di squadra + */ + public King(Cell cell, Team.TEAMTYPE teamtype,Board board) { + super(cell,teamtype,board); + setSprite(teamtype.toString(),"King"); + getSprite().setOrigin(new Point(-50,-80)); + Point position = new Point(getSprite().getOrigin().x + cell.getSprite().getCenter().x, + getSprite().getOrigin().y + cell.getSprite().getCenter().y); + getSprite().setPosition(position); + getSpriteOutline().setPosition(position); + setSpriteOutline(teamtype.toString(),"King-outline"); + } + + @Override + public ArrayList getValidCells() { + + ArrayList cells = new ArrayList<>(); + + int currentColumn = getCurrentCell().getCoord().y; + int currentRow = getCurrentCell().getCoord().x; + + if(currentColumn+1<8 && currentRow-1>=0){ + cells.add(getBoard().getColumn(currentColumn+1).get(currentRow-1)); + } + if(currentRow-1>=0) { + cells.add(getBoard().getColumn(currentColumn).get(currentRow - 1)); + } + + if(currentColumn-1<8 && currentRow+1<8){ + cells.add(getBoard().getColumn(currentColumn - 1).get(currentRow+1)); + } + if(currentRow + 1 < 8) + cells.add(getBoard().getColumn(currentColumn).get(currentRow + 1)); + + if(currentColumn + 1 < 8) + cells.add(getBoard().getColumn(currentColumn + 1).get(currentRow)); + + if(currentColumn - 1>=0) + cells.add(getBoard().getColumn(currentColumn - 1).get(currentRow)); + + if(currentColumn - 1>=0 && currentRow - 1>=0) + cells.add(getBoard().getColumn(currentColumn - 1).get(currentRow-1)); + + if(currentColumn + 1 < 8 && currentRow + 1 < 8) + cells.add(getBoard().getColumn(currentColumn + 1).get(currentRow+1)); + + return cells; } } diff --git a/Actors/Knight.java b/Actors/Knight.java index 4324d43..4de161e 100644 --- a/Actors/Knight.java +++ b/Actors/Knight.java @@ -1,13 +1,60 @@ package Actors; +import Terrain.Board; import Terrain.Cell; +import java.awt.*; +import java.util.ArrayList; + /** * Created by dimaer on 27/03/17. */ -public class Knight extends Pawn { - public Knight(Cell cell, Team.TEAMTYPE teamtype) { - super(cell, teamtype); +public class Knight extends Piece { + /** + * + * Costruttore di Knight + * @param cell cella iniziale + * @param teamtype tipo di squadrae + */ + public Knight(Cell cell, Team.TEAMTYPE teamtype,Board board) { + super(cell,teamtype,board); + + getSprite().setOrigin(new Point(-50,-118)); + Point position = new Point(getSprite().getOrigin().x + cell.getSprite().getCenter().x, + getSprite().getOrigin().y + cell.getSprite().getCenter().y); + getSprite().setPosition(position); + getSpriteOutline().setPosition(position); + setSprite(teamtype.toString(),"Knight"); + + setSpriteOutline(teamtype.toString(),"Knight-outline"); + } + @Override + public ArrayList getValidCells(){ + + ArrayList cells = new ArrayList<>(); + int currentColumn = getCurrentCell().getCoord().y; + int currentRow = getCurrentCell().getCoord().x; + + if(currentColumn+1<8 && currentRow+2<8) + cells.add(getBoard().getColumn(currentColumn + 1).get(currentRow + 2)); + + if(currentColumn+2<8 && currentRow+1<8) + cells.add(getBoard().getColumn(currentColumn+2).get(currentRow+1)); + if(currentColumn-1>=0 && currentRow+2<8) + cells.add(getBoard().getColumn(currentColumn-1).get(currentRow+2)); + if(currentColumn-2>=0 && currentRow+1<8) + cells.add(getBoard().getColumn(currentColumn-2).get(currentRow+1)); + if(currentColumn+2<8 && currentRow-1>=0) + cells.add(getBoard().getColumn(currentColumn+2).get(currentRow-1)); + if(currentColumn+1<8 && currentRow-2>=0) + cells.add(getBoard().getColumn(currentColumn+1).get(currentRow-2)); + if(currentColumn-2>=0 && currentRow-1>=0) + cells.add(getBoard().getColumn(currentColumn-2).get(currentRow-1)); + if(currentColumn-1>=0 && currentRow-2>=0) + cells.add(getBoard().getColumn(currentColumn-1).get(currentRow-2)); + + return cells; + } } diff --git a/Actors/Pawn.java b/Actors/Pawn.java index ab590e4..6488507 100644 --- a/Actors/Pawn.java +++ b/Actors/Pawn.java @@ -1,63 +1,65 @@ package Actors; -import Components.Graphics.Drawable; -import Components.Event.MouseObserver; -import Components.Graphics.Sprite; -import Core.GameObject; -import Core.ResourceLoader; +import Terrain.Board; import Terrain.Cell; import java.awt.*; -import java.awt.event.MouseEvent; +import java.util.ArrayList; + /** * Created by dimaer on 25/03/17. */ -public class Pawn extends GameObject implements Drawable, MouseObserver { - - private Sprite sprite; - private Cell current_cell; - private Team.TEAMTYPE team; - public Pawn(){}; - public Pawn(Cell cell, Team.TEAMTYPE team) - { - super(cell.getPosition()); - current_cell = cell; - sprite = new Sprite(cell.getSprite().getCenter()); - this.team = team; +public class Pawn extends Piece { - } - protected void setSprite(String id){ - sprite.setImage(ResourceLoader.getInstance().LoadSprite("1","Pawn")); - } - /** - * Metodo che sposta la piedina - * @param cell cella della nuova posizione - */ - public void Move(Cell cell){ - current_cell = cell; - setPosition(current_cell.getSprite().getCenter()); - } + public Pawn(){} /** - * Metodo che torna cella corrente - * @return L'oggetto di tipo Terrain.Cell + * + * Costruttore di Pawn + * @param cell cella iniziale + * @param teamtype tipo di squadra */ - public Cell getCell() + public Pawn(Cell cell, Team.TEAMTYPE teamtype,Board board) { - return current_cell; - } - public Sprite getSprite() - { - return sprite; - } - @Override - public void draw(Graphics graphics) { - sprite.draw(graphics); + super(cell,teamtype,board); + + getSprite().setOrigin(new Point(-50,-75)); + Point position = new Point(getSprite().getOrigin().x + cell.getSprite().getCenter().x, + getSprite().getOrigin().y + cell.getSprite().getCenter().y); + getSprite().setPosition(position); + getSpriteOutline().setPosition(position); + setSprite(teamtype.toString(),"Pawn"); + setSpriteOutline(teamtype.toString(),"Pawn-outline"); } @Override - public void update(MouseEvent mouseEvent, String message) { + public ArrayList getValidCells() { + + ArrayList cells = new ArrayList<>(); + + int currentColumn = getCurrentCell().getCoord().y; + int currentRow = getCurrentCell().getCoord().x; + + boolean breakCellUp = false; + if(getTeam()== Team.TEAMTYPE.Blue) { + if (currentRow == 6) { + if(getBoard().getColumn(currentColumn).get(currentRow - 1).isEmpty() && !breakCellUp){ + cells.add(getBoard().getColumn(currentColumn).get(currentRow - 1)); + if(getBoard().getColumn(currentColumn).get(currentRow - 2).isEmpty()) + getBoard().getColumn(currentColumn).get(currentRow - 2); + } + } else + if(getBoard().getColumn(currentColumn).get(currentRow - 1).isEmpty()) + cells.add(getBoard().getColumn(currentColumn).get(currentRow - 1)); + } else { + if(currentRow == 1 ){ + cells.add(getBoard().getColumn(currentColumn).get(currentRow + 1)); + cells.add(getBoard().getColumn(currentColumn).get(currentRow + 2)); + } else + cells.add(getBoard().getColumn(currentColumn).get(currentRow + 1)); + } + return cells; } } diff --git a/Actors/Piece.java b/Actors/Piece.java new file mode 100644 index 0000000..c4a1288 --- /dev/null +++ b/Actors/Piece.java @@ -0,0 +1,166 @@ +package Actors; + +import Components.Graphics.Sprite; +import Core.GameObject; +import Core.ResourceLoader; +import Terrain.Board; +import Terrain.Cell; + +import java.awt.*; +import java.awt.event.MouseEvent; +import java.util.ArrayList; + +/** + * Created by dimaer on 21/06/17. + */ +public abstract class Piece extends GameObject{ + + + private Sprite spriteOutline; + + private Cell currentCell; + + private Team.TEAMTYPE team; + private Board board; + /** + *Costruttore di Piece + */ + public Piece(){} + + /** + *Costruttore di Piece + * @param cell cella iniziale + * @param team tipo di squadra + */ + public Piece(Cell cell, Team.TEAMTYPE team, Board board){ + super(cell.getPosition()); + this.team = team; + + this.board = board; + + spriteOutline = new Sprite(cell.getPosition()); + spriteOutline.setVisibility(false); + currentCell = cell; + currentCell.setEmpty(false); + + getSprite().setDepth(getCurrentCell().getSprite().getDepth()); + getSpriteOutline().setDepth(getCurrentCell().getSprite().getDepth()); + + } + + /** + * Metodo che sposta la piedina + * @param cell cella della nuova posizione + */ + public void Move(Cell cell){ + + setCurrentCell(cell); + Point position = new Point(getSprite().getOrigin().x + cell.getSprite().getCenter().x, + getSprite().getOrigin().y + cell.getSprite().getCenter().y); + getSprite().setPosition(position); + getSpriteOutline().setPosition(position); + + getSprite().setDepth(getCurrentCell().getSprite().getDepth()); + getSpriteOutline().setDepth(getCurrentCell().getSprite().getDepth()); + + } + public abstract ArrayList getValidCells(); + /** + *Metodo che imposta la cella corrente + * @param currentCell cella da impostare + */ + public void setCurrentCell(Cell currentCell) { + this.currentCell.setEmpty(true); + this.currentCell = currentCell; + this.currentCell.setEmpty(false); + } + + /** + *Metodo che torna la cella corrente + * @return cella corrente + */ + public Cell getCurrentCell() { + return currentCell; + } + + /** + * Metodo che ritorna oggetto della scachiera + * @return scachiera + */ + public Board getBoard() { + return board; + } + + /** + *Metodo che torna tipo di squadra + * @return tipo di squadra + */ + + public Team.TEAMTYPE getTeam() { + return team; + } + + /** + *Metodo che imposta la nuova posizione + * @param position nuova posizione + */ + @Override + public void setPosition(Point position) { + super.setPosition(position); + spriteOutline.setPosition(position); + } + + /** + *Metodo che carica sprite con pedina evidenziata + * @param Team tipo di squadra + * @param id il nome di sprite specificato in Resources.xml + */ + protected void setSpriteOutline(String Team, String id){ + spriteOutline.setImage(ResourceLoader.getInstance().LoadSprite(Team,id)); + } + + /** + *Metodo che torna sprite di pedina evidenziata + * @return sprite di pedina evidenziata + */ + public Sprite getSpriteOutline(){ + return spriteOutline; + } + + /** + *Metodo che disgena la pedina + * @param graphics instanza di Graphics + */ + @Override + public void draw(Graphics graphics) { + if(isVisibility()){ + super.draw(graphics); + spriteOutline.draw(graphics); + } + } + + /** + *Metodo che imposta la selezione + * @param selected + */ + @Override + public void setSelected(boolean selected) { + super.setSelected(selected); + spriteOutline.setVisibility(selected); + } + + /** + *Metodo che aggiorna la pedina + * @param mouseEvent evento di Mouse + */ + @Override + public void update(MouseEvent mouseEvent) { + super.update(mouseEvent); + if(isSelected()){ + spriteOutline.setVisibility(true); + } + else { + spriteOutline.setVisibility(false); + } + } +} diff --git a/Actors/Queen.java b/Actors/Queen.java index 8f2853c..add2556 100644 --- a/Actors/Queen.java +++ b/Actors/Queen.java @@ -1,14 +1,177 @@ package Actors; +import Terrain.Board; import Terrain.Cell; import java.awt.*; +import java.util.ArrayList; /** * Created by dimaer on 27/03/17. */ -public class Queen extends Pawn{ - public Queen(Cell cell, Team.TEAMTYPE teamtype) { - super(cell,teamtype); +public class Queen extends Piece{ + /** + * + * Costruttore di Queen + * @param cell cella iniziale + * @param teamtype tipo di squadra + */ + public Queen(Cell cell, Team.TEAMTYPE teamtype,Board board) { + super(cell,teamtype,board); + getSprite().setOrigin(new Point(-50,-118)); + Point position = new Point(getSprite().getOrigin().x + cell.getSprite().getCenter().x, + getSprite().getOrigin().y + cell.getSprite().getCenter().y); + getSprite().setPosition(position); + getSpriteOutline().setPosition(position); + setSprite(teamtype.toString(),"Queen"); + setSpriteOutline(teamtype.toString(),"Queen-outline"); + } + /*public boolean checkCell(Cell cell){ + + }*/ + + @Override + public ArrayList getValidCells() { + + ArrayList cells = new ArrayList<>(); + + int currentColumn = getCurrentCell().getCoord().y; + int currentRow = getCurrentCell().getCoord().x; + + boolean breakCellUp = false; + boolean breakCellDown = false; + boolean breakCellLeft = false; + boolean breakCellRight = false; + boolean breakCellUpLeft = false; + boolean breakCellUpRight = false; + boolean breakCellDownLeft = false; + boolean breakCellDownRight = false; + + Cell cellUp,cellDown,cellLeft,cellRight,cellUpRight,cellUpLeft,cellDownRight,cellDownLeft; + + for(int i = 1;i<8;i++){ + if(currentRow - i>=0) { + + cellUp = getBoard().getColumn(currentColumn).get(currentRow - i); + + if (cellUp.isEmpty() && !breakCellUp) + cells.add(cellUp); + else{ + if(!breakCellUp){ + cells.add(cellUp); + breakCellUp = true; + } + + } + + } + if(currentColumn - i>=0){ + cellLeft = getBoard().getColumn(currentColumn-i).get(currentRow); + if(cellLeft.isEmpty() && !breakCellLeft) + cells.add(cellLeft); + else{ + if(!breakCellLeft){ + cells.add(cellLeft); + breakCellLeft = true; + } + + } + } + } + for(int i = 1;i<8;i++){ + if(currentRow + i<8) { + + cellDown = getBoard().getColumn(currentColumn).get(currentRow + i); + + if (cellDown.isEmpty() && !breakCellDown) + cells.add(cellDown); + else{ + if(!breakCellDown){ + cells.add(cellDown); + breakCellDown = true; + } + } + } + + if(currentColumn + i<8){ + + cellRight = getBoard().getColumn(currentColumn+i).get(currentRow); + + if(cellRight.isEmpty() && !breakCellRight) + cells.add(cellRight); + else{ + if(!breakCellRight){ + cells.add(cellRight); + breakCellRight = true; + } + } + } + } + + for(int i = 1;i<8;i++){ + + if(currentColumn+i<8 && (currentRow - i)>=0) { + + cellUpRight = getBoard().getColumn(currentColumn + i).get(currentRow - i); + + if (cellUpRight.isEmpty() && !breakCellUpRight) + cells.add(cellUpRight); + else { + if(!breakCellUpRight){ + cells.add(cellUpRight); + breakCellUpRight = true; + } + } + } + + if(currentColumn - i>=0 && (currentRow - i)>=0) { + + cellUpLeft = getBoard().getColumn(currentColumn - i).get(currentRow - i); + + if (cellUpLeft.isEmpty() && !breakCellUpLeft) + cells.add(cellUpLeft); + else{ + if(!breakCellUpLeft){ + cells.add(cellUpLeft); + breakCellUpLeft = true; + } + + } + } + } + + for(int i = 1;i<8;i++){ + + if(currentColumn + i<8 && (currentRow + i)<8) { + + cellDownRight = getBoard().getColumn(currentColumn + i).get(currentRow + i); + + if (cellDownRight.isEmpty() && !breakCellDownRight) + cells.add(cellDownRight); + else{ + if(!breakCellDownRight){ + cells.add(cellDownRight); + breakCellDownRight = true; + } + + } + } + + if(currentColumn - i>=0 && (currentRow + i)<8) { + + cellDownLeft = getBoard().getColumn(currentColumn - i).get(currentRow + i); + + if (cellDownLeft.isEmpty() && !breakCellDownLeft) + cells.add(cellDownLeft); + else{ + if(!breakCellDownLeft){ + cells.add(cellDownLeft); + breakCellDownLeft = true; + } + } + + } + } + return cells; } } diff --git a/Actors/Rook.java b/Actors/Rook.java index 38caace..e3627cd 100644 --- a/Actors/Rook.java +++ b/Actors/Rook.java @@ -1,12 +1,92 @@ package Actors; +import Terrain.Board; import Terrain.Cell; +import java.awt.*; +import java.util.ArrayList; + /** * Created by dimaer on 27/03/17. */ -public class Rook extends Pawn { - public Rook(Cell cell, Team.TEAMTYPE teamtype) { - super(cell,teamtype); +public class Rook extends Piece { + /** + * Costruttore di Rook + * @param cell cella iniziale + * @param teamtype tipo di squadra + */ + public Rook(Cell cell, Team.TEAMTYPE teamtype,Board board) { + super(cell,teamtype,board); + getSprite().setOrigin(new Point(-45,-145)); + Point position = new Point(getSprite().getOrigin().x + cell.getSprite().getCenter().x, + getSprite().getOrigin().y + cell.getSprite().getCenter().y); + getSprite().setPosition(position); + getSpriteOutline().setPosition(position); + setSprite(teamtype.toString(),"Rook"); + setSpriteOutline(teamtype.toString(),"Rook-outline"); + } + + @Override + public ArrayList getValidCells() { + + ArrayList cells = new ArrayList<>(); + + int currentColumn = getCurrentCell().getCoord().y; + int currentRow = getCurrentCell().getCoord().x; + + boolean breakCellUp = false; + boolean breakCellLeft = false; + boolean breakCellDown = false; + boolean breakCellRight = false; + + for(int i = 1;i<8;i++){ + if(currentRow-i>=0) { + if (getBoard().getColumn(currentColumn).get(currentRow - i) .isEmpty() && !breakCellUp) + cells.add(getBoard().getColumn(currentColumn).get(currentRow - i)); + else{ + if(!breakCellUp){ + cells.add(getBoard().getColumn(currentColumn).get(currentRow - i)); + breakCellUp = true; + } + + } + + } + if(currentColumn-i>=0){ + if(getBoard().getColumn(currentColumn-i).get(currentRow).isEmpty() && !breakCellLeft) + cells.add(getBoard().getColumn(currentColumn-i).get(currentRow)); + else { + if(!breakCellLeft){ + cells.add(getBoard().getColumn(currentColumn-i).get(currentRow)); + breakCellLeft = true; + } + } + } + } + for(int i = 1;i<8;i++){ + if(currentRow+i<8) { + if (getBoard().getColumn(currentColumn).get(currentRow + i).isEmpty() && !breakCellDown) + cells.add(getBoard().getColumn(currentColumn).get(currentRow + i)); + else{ + if(!breakCellDown){ + cells.add(getBoard().getColumn(currentColumn).get(currentRow + i)); + breakCellDown = true; + } + } + + } + if(currentColumn+i<8){ + if(getBoard().getColumn(currentColumn+i).get(currentRow).isEmpty() && !breakCellRight) + cells.add(getBoard().getColumn(currentColumn+i).get(currentRow)); + else{ + if(!breakCellRight){ + cells.add(getBoard().getColumn(currentColumn+i).get(currentRow)); + breakCellRight = true; + } + } + + } + } + return cells; } } diff --git a/Actors/Team.java b/Actors/Team.java index 9418d03..a220179 100644 --- a/Actors/Team.java +++ b/Actors/Team.java @@ -1,34 +1,121 @@ package Actors; +import Components.Event.MouseObserver; +import Components.Graphics.Drawable; +import Terrain.Board; + +import java.awt.*; +import java.awt.event.MouseEvent; import java.util.ArrayList; /** * Created by dimaer on 31/03/17. */ -public class Team { - private ArrayList members; +public class Team implements Drawable,MouseObserver { + + private ArrayList members; TEAMTYPE teamtype; - public Team(TEAMTYPE teamtype) + + /** + * + * @param teamtype + * @param board + */ + public Team(TEAMTYPE teamtype,Board board) { members = new ArrayList<>(); this.teamtype = teamtype; + //generateTeam(board); } - enum TEAMTYPE{ - RED,BLUE + + public enum TEAMTYPE{ + Red, Blue } - private void generateTeam(){ - if(teamtype == TEAMTYPE.RED){ - + /*private void generateTeam(Board board){ + if(teamtype == TEAMTYPE.Red){ + + } + if(teamtype == TEAMTYPE.Blue){ + for (int i = 0 ;i<8;i++){ + Pawn pawn = new Pawn(board.getCell(6,(char)('a'+i)),TEAMTYPE.Blue); + addMember(pawn); + } + addMember(new Rook(board.getCell(7,'a'),TEAMTYPE.Blue,board)); + addMember(new Knight(board.getCell(7,'b'),TEAMTYPE.Blue,board)); + addMember(new Bishop(board.getCell(7,'c'),TEAMTYPE.Blue,board)); + addMember(new Queen(board.getCell(7,'d'),TEAMTYPE.Blue,board)); + addMember(new Bishop(board.getCell(7,'f'),TEAMTYPE.Blue,board)); + addMember(new Knight(board.getCell(7,'g'),TEAMTYPE.Blue,board)); + + addMember(new King(board.getCell(7,'e'),TEAMTYPE.Blue)); + + + + addMember(new Rook(board.getCell(7,'h'),TEAMTYPE.Blue)); + + } } +*/ + /** + * + * @return + */ public int getTeamSize(){ return members.size(); } - public void deleteMember(Pawn member){ + + /** + * + * @param member + */ + public void deleteMember(Piece member){ members.remove(member); } - public void addMember(Pawn member){ + + /** + * + * @param member + */ + public void addMember(Piece member){ members.add(member); } + /** + * + * @return + */ + public ArrayList getMembers() { + return members; + } + + /** + * + * @return + */ + public TEAMTYPE getTeamtype() { + return teamtype; + } + + /** + * + * @param graphics instanza di Graphics + */ + @Override + public void draw(Graphics graphics) { + for (Piece piece : members){ + piece.draw(graphics); + } + } + + /** + * + * @param mouseEvent evento di Mouse + */ + @Override + public void update(MouseEvent mouseEvent) { + for(Piece p : members) { + p.update(mouseEvent); + } + } } diff --git a/Components/Event/MouseActions.java b/Components/Event/MouseActions.java deleted file mode 100644 index cfbc5a0..0000000 --- a/Components/Event/MouseActions.java +++ /dev/null @@ -1,7 +0,0 @@ -package Components.Event; - -/** - * Created by dimaer on 25/03/17. - */ -public class MouseActions { -} diff --git a/Components/Event/MouseObserver.java b/Components/Event/MouseObserver.java index 44cc4de..e3f890f 100644 --- a/Components/Event/MouseObserver.java +++ b/Components/Event/MouseObserver.java @@ -1,9 +1,14 @@ package Components.Event; import java.awt.event.MouseEvent; /** + * * Created by dimaer on 22/03/17. */ -/**Сделать рефактор имени.Делать проверку типов*/ + public interface MouseObserver { - void update(MouseEvent mouseEvent,String message); + /** + * + * @param mouseEvent + */ + void update(MouseEvent mouseEvent); } diff --git a/Components/Graphics/Drawable.java b/Components/Graphics/Drawable.java index 70f7936..eb67340 100644 --- a/Components/Graphics/Drawable.java +++ b/Components/Graphics/Drawable.java @@ -2,9 +2,13 @@ import java.awt.*; -/** +/**Interfaccia principale per tutte le entita' che devono essere disegnati * Created by dimaer on 19/03/17. */ public interface Drawable { + /** + *Metodo che disegna sul canvas + * @param graphics instanza di Graphics + */ void draw(Graphics graphics); } diff --git a/Components/Graphics/Gui/Button.java b/Components/Graphics/Gui/Button.java index b033c9c..2f0905e 100644 --- a/Components/Graphics/Gui/Button.java +++ b/Components/Graphics/Gui/Button.java @@ -9,17 +9,27 @@ import Components.Graphics.Drawable; public class Button implements Drawable,MouseObserver { + private Rectangle boundRect; private MouseListener mouseListener; + private String label; /** - * Costruttore + * Costruttore di Button * @param BoundRect Dimensioni di rettangolo */ - public Button(Rectangle BoundRect) + public Button(Rectangle BoundRect,String label) { boundRect = BoundRect; + this.label=label; } + /** + *Metodo che imposta testo per il pulsante + * @param label testo + */ + public void setLabel(String label){ + this.label = label; + } /** * Metodo che imposta le dimensioni di rettangolo * @param BoundRect Dimensioni di rettangolo @@ -32,17 +42,17 @@ public void setBoundRect(Rectangle BoundRect) /** * Metodo che aggiorna il componente quando esso riceve il messagio (L'evento) * @param mouseEvent L'evento di mouse - * @param message messagio di evento + * */ @Override - public void update(MouseEvent mouseEvent, String message) { - if(message.equals("MOUSE_CLICKED")) + public void update(MouseEvent mouseEvent) { + if(mouseEvent.getID()==MouseEvent.MOUSE_CLICKED) { if(isContainMouse(mouseEvent)) mouseListener.mouseClicked(mouseEvent); } - if(message.equals("MOUSE_MOVED")) + if(mouseEvent.getID()==MouseEvent.MOUSE_MOVED) { if(isContainMouse(mouseEvent)) mouseListener.mouseEntered(mouseEvent); @@ -50,8 +60,8 @@ public void update(MouseEvent mouseEvent, String message) { } /** - * - * @param mouseListener + *Aggiunge MouseListener + * @param mouseListener MouseListener */ public void addMouseListener(MouseListener mouseListener){ this.mouseListener = mouseListener; @@ -70,8 +80,15 @@ private boolean isContainMouse(MouseEvent mouseEvent) return false; } + /** + *Metodo che disegna il pulsante + * @param graphics oggetto di classe Graphics + */ @Override public void draw(Graphics graphics) { graphics.drawRect(boundRect.x,boundRect.y,boundRect.width,boundRect.height); + FontMetrics fm = graphics.getFontMetrics(); + + graphics.drawString(label,boundRect.x + boundRect.width/2 - fm.stringWidth(label)/2,boundRect.y + boundRect.height/2 + fm.getHeight()/2); } } diff --git a/Components/Graphics/Gui/GraphicsComponent.java b/Components/Graphics/Gui/GraphicsComponent.java deleted file mode 100644 index 750400e..0000000 --- a/Components/Graphics/Gui/GraphicsComponent.java +++ /dev/null @@ -1,7 +0,0 @@ -package Components.Graphics.Gui; - -/** - * Created by dimaer on 27/03/17. - */ -public class GraphicsComponent { -} diff --git a/Components/Graphics/Gui/Label.java b/Components/Graphics/Gui/Label.java new file mode 100644 index 0000000..4e9388c --- /dev/null +++ b/Components/Graphics/Gui/Label.java @@ -0,0 +1,66 @@ +package Components.Graphics.Gui; + +import Components.Graphics.Drawable; + +import java.awt.*; + +/**Classe che descrive etichetta + * Created by dimaer on 21/06/17. + */ +public class Label implements Drawable{ + + private Point position; + + private String text; + + /** + * Costruttore di Label + * @param text testo di etichetta + * @param position posizione sullo schermo + */ + public Label(String text,Point position){ + this.position = position; + this.text = text; + } + + /** + *Metodo che torna la posizione sullo schermo + * @return posizione sullo schermo + */ + public Point getPosition(){ + return position; + } + + /** + *Metodo che imposta la posizione + * @param position posizione sullo schermo + */ + public void setPosition(Point position){ + this.position = position; + } + + /** + *Metodo che torna il testo di etichetta + * @return il testo di etichetta + */ + public String getText(){ + return text; + } + + /** + *Metodo che imposta il testo a etichetta + * @param text testo da impostare + */ + public void setText(String text){ + this.text = text; + } + + /** + * Metodo che disegna etichetta + * @param graphics instanza di Graphics + */ + @Override + public void draw(Graphics graphics) { + graphics.drawString(text,position.x,position.y); + } +} diff --git a/Components/Graphics/Layer.java b/Components/Graphics/Layer.java deleted file mode 100644 index c1880e5..0000000 --- a/Components/Graphics/Layer.java +++ /dev/null @@ -1,22 +0,0 @@ -package Components.Graphics; - -import java.awt.*; -import java.util.*; -import java.util.List; - -/** - * Created by dimaer on 05/04/17. - */ -public class Layer implements Drawable { - private ArrayList elements; - public Layer(){ - elements = new ArrayList<>(); - } - - @Override - public void draw(Graphics graphics) { - for(Drawable e : elements){ - e.draw(graphics); - } - } -} diff --git a/Components/Graphics/Sprite.java b/Components/Graphics/Sprite.java index fcbd71a..565b89a 100644 --- a/Components/Graphics/Sprite.java +++ b/Components/Graphics/Sprite.java @@ -9,7 +9,7 @@ /** * Created by dimaer on 20/03/17. - * La classe Components.Graphics.Sprite rappresenta il componente principale di rendering + * La classe Sprite rappresenta il componente principale di rendering * */ @@ -20,13 +20,8 @@ public class Sprite implements Drawable { private BufferedImage image; private File imageFile; private int depth; - private ImageObserver imageObserver = new ImageObserver() { - @Override - public boolean imageUpdate(Image image, int i0, int i1, int i2, int i3, int i4) { - return false; - - } - }; + private ImageObserver imageObserver; + private boolean visibility; /** *Funzione che torna file di immagine @@ -37,13 +32,40 @@ public File getFile() return imageFile; } + /** + *Costruttore di Sprite + */ + public Sprite(){ + + position = new Point(0,0); + + visibility = true; + + imageObserver = new ImageObserver() { + @Override + public boolean imageUpdate(Image image, int i0, int i1, int i2, int i3, int i4) { + return false; + + } + }; + } /** * Costruttore che assegna ad ogni istanza la posizione iniziale * @param position posizione di locazione di Components.Graphics.Sprite */ public Sprite(Point position) { + visibility = true; + this.position = position; + + imageObserver = new ImageObserver() { + @Override + public boolean imageUpdate(Image image, int i0, int i1, int i2, int i3, int i4) { + return false; + + } + }; } /** @@ -57,31 +79,118 @@ public void setImage(String path) image = ImageIO.read(imageFile); }catch (IOException e){ - System.out.print(e.getMessage() + " " + path); + System.out.println(e.getMessage() + " " + path); } } + /** + * Metodo che torna immagine impostata + * @return immagine impostata + */ + public BufferedImage getImage() { + return image; + } + /** * Metodo che torna la posizione corrente - * @return Point vettore di posizione corrente + * @return vettore di posizione corrente */ public Point getPosition() { return position; } + /** + *Il metodo che imposta la posizione di sprite sullo schermo + * @param vector la posizione da impostare + */ + public void setPosition(Point vector){position = vector;} /** * Il metodo che calcola le coordinate del centro di sprite rispetto all'immagine - * @return Point vettore dell centro + * @return le coordinate dell centro */ public Point getCenter(){ Point imageCenter = new Point(image.getWidth(imageObserver)/2,image.getHeight(imageObserver)/2); - return new Point(position.x + imageCenter.x,position.y + imageCenter.y); + + return new Point(position.x + imageCenter.x,position.y + imageCenter.y - 20); + } + + /** + *Metodo che imposta le coordinate d'origine di sprite + * @param origin le coordinate nuove d'origine + */ + public void setOrigin(Point origin) { + this.origin = origin; + } + + /** + *Metodo che torna le cooridinate d'origine + * @return coordinate d'origine + */ + public Point getOrigin() { + return origin; + } + + /** + *Metodo che imposta la visibilita di sprite sullo schermo + * @param visibility flag di visibilita + */ + public void setVisibility(boolean visibility) { + this.visibility = visibility; } + /** + *Metodo che torna flag di visibilita' + * @return + */ + public boolean isVisibility() { + return visibility; + } + + /** + *Metodo che verifica se il punto sullo schermo e' contenuto nella regione di sprite + * @param point le coordinate del punto + * @return true se e' contenuto , false se il punto e' fuori + */ + public boolean isContainPoint(Point point){ + if(point.y >= getPosition().y && point.y <= image.getHeight() + getPosition().y) + if(point.x >= getPosition().x && point.x <= image.getWidth() + getPosition().x) + return true; + + return false; + } + + /** + *Metodo che verifica se il punto sullo schermo e' sovrapposto sui pixel di sprite + * @param point le coordinate del punto + * @return true se e' contenuto , false se il punto e' fuori + */ + public boolean perPixelCollision(Point point){ + if(isContainPoint(point)) + { + Point coord = new Point(point.x - getPosition().x,point.y - getPosition().y); + if(coord.x<=0) + coord.x = 0; + if(coord.y<=0) + coord.y = 0; + + int colour = getImage().getRGB(coord.x,coord.y); + + /*int red = (colour & 0x00ff0000) >> 16; + int green = (colour & 0x0000ff00) >> 8; + int blue = colour & 0x000000ff;*/ + int alpha = (colour>>24) & 0xff; + + if(alpha!=0){ + return true; + } + + } + return false; + } /** * Metodo che torna l'ordine di rendering - * @return int ordine di render + * @return ordine di render */ public int getDepth() { return depth; @@ -95,11 +204,12 @@ public void setDepth(int depth) { this.depth = depth; } /** - * Metodo che disegna l'immagine + * Metodo che disegna sprite * @param graphics */ @Override public void draw(Graphics graphics){ + if(visibility) graphics.drawImage(image,position.x,position.y,imageObserver); } diff --git a/Core/GameManager.java b/Core/GameManager.java deleted file mode 100644 index 25a1697..0000000 --- a/Core/GameManager.java +++ /dev/null @@ -1,20 +0,0 @@ -package Core; - -/** - * Created by dimaer on 05/04/17. - */ -public final class GameManager { - Screen screen; - - private GameManager(){ - - } - private static final GameManager gm = new GameManager(); - - public static GameManager getInstance(){ - return gm; - } - public static void Run(){ - - } -} diff --git a/Core/GameObject.java b/Core/GameObject.java index dd26e47..532017f 100644 --- a/Core/GameObject.java +++ b/Core/GameObject.java @@ -1,34 +1,176 @@ package Core; -import Terrain.Cell; +import Components.Event.MouseObserver; +import Components.Graphics.Drawable; +import Components.Graphics.Sprite; import java.awt.*; +import java.awt.event.MouseEvent; /** * Created by dimaer on 24/03/17. + * La classe base di tutti le entita' interattive */ -public class GameObject{ - Point position; - Rectangle boundRect; - public GameObject(){}; +public class GameObject implements Drawable, MouseObserver { + + private boolean selected; + + private Sprite sprite; + + private Point position; + + + private boolean visibility; + private boolean active; + + private Rectangle boundRect; + + /** + * Costruttore di GameObject + */ + public GameObject(){} + + /** + * Costruttore di GameObject + * @param position posizione iniziale + */ public GameObject(Point position) { + + active = true; + visibility = true; this.position = position; + + sprite = new Sprite(position); } + /** + *Metodo che attiva GameObject + * @param active flag + */ + public void setActive(boolean active) { + this.active = active; + } + + /** + *Metodo che torna flag + * @return true se GameObject e' attivo invece false + */ + public boolean isActive() { + return active; + } + + /** + *Metodo che verifica se oggetto e' visibile + * @return + */ + public boolean isVisibility() { + return visibility; + } + + /** + * Metodo setter della posizione di oggetto + * @param position + */ public void setPosition(Point position) { this.position = position; + sprite.setPosition(position); } + /** + * Metodo che imposta la regione attiva di oggetto + * @param boundRect rettangolo della regione + */ public void setBoundRect(Rectangle boundRect) { this.boundRect = boundRect; } + /** + *Metodo che carica sprite dalla memmoria di massa + * @param Team Squadra + * @param id Nome di file che e' stato impostato in Resources.xml + */ + public void setSprite(String Team,String id){ + sprite.setImage(ResourceLoader.getInstance().LoadSprite(Team,id)); + } + + /** + *Metodo che imposta sprite + * @param sprite sprite da impostare + */ + public void setSprite(Sprite sprite) { + this.sprite = sprite; + } + + /** + *Metodo che torna sprite corrente + * @return sprite corrente + */ + public Sprite getSprite() { + return sprite; + } + + /** + * Metodo gettere della posizione di oggetto + * @return posizione corrente sullo schermo + */ public Point getPosition() { return position; } + /** + * Metodo getter della regione attiva di oggetto + * @return rettangolo della regione + */ public Rectangle getBoundRect() { return boundRect; } + + /** + *Metodo che imposta se l'ogetto e' stato selezionato + * @param selected flag + */ + public void setSelected(boolean selected) { + this.selected = selected; + } + + /** + *Metodo che verifica se l'ogetto e' stato selezionate + * @return flag + */ + public boolean isSelected() { + return selected; + } + + /** + *Metodo che disegna l'oggetto + * @param graphics instanza di Graphics + */ + @Override + public void draw(Graphics graphics) { + if(isVisibility()) + sprite.draw(graphics); + } + + /** + *Metodo viene invocato ad ogni evento di mouse + * @param mouseEvent + */ + @Override + public void update(MouseEvent mouseEvent) { + if(isActive()) { + Point mouse = new Point(mouseEvent.getX(), mouseEvent.getY()); + + if (mouseEvent.getID() == MouseEvent.MOUSE_MOVED) { + + + } + if (mouseEvent.getID() == MouseEvent.MOUSE_CLICKED) { + if (getSprite().perPixelCollision(mouse)) { + + } + + } + } + } } diff --git a/Core/ResourceLoader.java b/Core/ResourceLoader.java index 1642d22..e44784e 100644 --- a/Core/ResourceLoader.java +++ b/Core/ResourceLoader.java @@ -2,7 +2,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; -import org.w3c.dom.Node; + import org.w3c.dom.NodeList; import javax.xml.parsers.DocumentBuilder; @@ -10,7 +10,7 @@ import java.io.File; /** - * Classe che carica le resource + * Classe che carica le resource facendo parsing dei file resource.xml e levels.xml * Created by dimaer on 27/03/17. */ public final class ResourceLoader { @@ -21,9 +21,11 @@ public final class ResourceLoader { private Document documentRes; private Document documentLevel; + private ResourceLoader(){ - resourceFile = new File("src/Resources.xml"); - levelFile = new File("src/Levels.xml"); + + resourceFile = new File(System.getProperty("user.dir") + "/Resources.xml"); + levelFile = new File(System.getProperty("user.dir") + "/Levels.xml"); dbFactory = DocumentBuilderFactory.newInstance(); try { dBuilder = dbFactory.newDocumentBuilder(); @@ -39,30 +41,17 @@ private ResourceLoader(){ /** * Metodo che torna l'istanza della classe - * @return + * @return ResourceLoader */ public static ResourceLoader getInstance(){ return resourceLoader; } - - /*public String LoadResource(String id,String type) - { - NodeList nodeList = documentRes.getElementsByTagName(type); - for(int i = 0; i < nodeList.getLength();i++){ - Element element = (Element) nodeList.item(i); - if(element.getAttribute("id").equals(id)) - return element.getElementsByTagName("path").item(0).getTextContent(); - - } - return "Error for load resource\n"; - }*/ - /** - * - * @param weatherType - * @param id - * @return + * Metodo che cerca il path nella cartela di applicazione di immagini definiti nella cartela resource.xml + * @param weatherType stagione + * @param id nome di sprite + * @return path del file */ public String LoadTile(String weatherType,String id) { @@ -84,27 +73,23 @@ public String LoadTile(String weatherType,String id) Element sprite = (Element) sprites.item(sprite_count); if(sprite.getAttribute("id").equals(id)){ - System.out.print("Load_Tile: [OK : " + sprite.getElementsByTagName("path").item(0).getTextContent() + "]" + "\n"); + String template = sprite.getElementsByTagName("path").item(0).getTextContent(); - //return sprite.getElementsByTagName("path").item(0).getTextContent(); - //System.out.print(template + "\n"); + return template; } } } } - System.out.print("Error for load tile: " + weatherType + " " + id + "\n"); + System.out.println("Error for load tile: " + weatherType + " " + id + "\n"); return ""; } - /*private boolean checkDocument(){ - documentRes.getDocumentURI(); - }*/ /** - * - * @param Team - * @param id - * @return + * Metodo che cerca path dei sprite considerati + * @param Team tipo di squadra + * @param id nome di sprite + * @return path del file */ public String LoadSprite(String Team,String id) { @@ -138,21 +123,20 @@ public String LoadSprite(String Team,String id) } } - System.out.print("Error for load resource: " + Team + " " + id + "\n"); + System.out.println("Error for load resource: " + Team + " " + id + "\n"); return ""; } /** - * - * @param text - * @return + * Metodo che decodifica la stringa che contiene il livelo nel file levels.xml + * @param text simbolo + * @return nome del sprite decodificato nel simbolo */ public String checkAnnotation(char text) { // NodeList annotations = documentRes.getElementsByTagName("Annotations"); - //for(int i = 0; i < annotations.getLength();i++) - //{ + Element annotationsRoot = (Element) annotations.item(0); // NodeList annotationList = annotationsRoot.getElementsByTagName("annotation"); @@ -160,17 +144,23 @@ public String checkAnnotation(char text) for(int annotation_count = 0;annotation_count Element root = (Element) documentLevel.getElementsByTagName("Levels").item(0); @@ -182,7 +172,7 @@ public String loadLevel(String id){ if(level.getAttribute("id").equals(id)){ String levelTemplate = level.getTextContent(); - System.out.print(formatString(levelTemplate)); + return formatString(levelTemplate); } } @@ -190,6 +180,12 @@ public String loadLevel(String id){ System.out.print("Not found level:" + id + "\n"); return ""; } + + /** + * Metodo che formatta la string eliminando gli spazi vuoti + * @param string testo da formattare + * @return stringa formattata + */ private String formatString(String string){ String temp = ""; for(int i = 0;i();Init();} + /** + *Costruttore della scena + */ + public Scene(){observers = new ArrayList<>();elements = new ArrayList<>();Init();} - /*public Scene(SCENE_TYPE sceneType) - { - this.sceneType = sceneType; - elements = new ArrayList(); - }*/ + /** + *Torna oggetti che sono interagiscono con il Mouse + * @return insieme di ogetti + */ + public ArrayList getObservers(){ + return observers; + } + /** + *Aggiunge l'elemento in render coda della scene + * @param element elemento da aggiungere + */ public void addElement(Drawable element) { elements.add(element); + if(element instanceof MouseObserver){ + observers.add((MouseObserver) element); //Se element anche e' instance di MouseObserver + // allora faccio cast + } + } + + /** + *Torna elementi che stanno in coda di render + * @return insieme di oggetti + */ + public List getElements() { + return elements; + } + + /** + *Metodo che invia l'evento di Mouse a tutti gli elementi di coda di render che sono interattivi con Mouse + * @param mouseEvent evento di Mouse + */ + public void notifyObservers(MouseEvent mouseEvent){ + for(MouseObserver obs : getObservers()) + obs.update(mouseEvent); + } + + /** + *Metodo che esegue bubbleSort sui elementi di coda rendering + */ + public void arrange(){ + for(int i = 0; i < elements.size(); i++) { + + boolean flag = false; + + for(int j = 0; j < elements.size()-1; j++) { + if (elements.get(j) instanceof Piece && elements.get(j + 1) instanceof Piece) { + Piece temp1 = (Piece) elements.get(j); + Piece temp2 = (Piece) elements.get(j + 1); + + if (temp1.getSprite().getDepth() > temp2.getSprite().getDepth()) { + Drawable element = elements.get(j); + elements.set(j, elements.get(j + 1)); + elements.set(j + 1, element); + flag = true; + } + + + } + } + + if(!flag) break; + } } /** * Metodo che torna il tipo di scena @@ -46,15 +114,23 @@ public SCENE_TYPE getSceneType() { return sceneType; } + + /** + *Metodo che imposta tipo di scena + * @param sceneType il tipo di scena + */ public void setSceneType(SCENE_TYPE sceneType){ this.sceneType = sceneType; } /** - * Disegna tutti i elementi che stanno dentro il contenitore + * Disegna tutti i elementi che stanno nella coda * @param graphics l'oggetto che si occupa di operazioni grafiche */ public void draw(Graphics graphics) { + + + arrange(); //Z-Order for(Drawable d : elements) { d.draw(graphics); diff --git a/Core/SceneManager.java b/Core/SceneManager.java index 6f49b97..d87f8c1 100644 --- a/Core/SceneManager.java +++ b/Core/SceneManager.java @@ -1,23 +1,34 @@ package Core; -import Core.Scene; +import Components.Event.MouseObserver; import java.awt.*; +import java.awt.event.MouseEvent; import java.util.ArrayList; -import java.util.List; + /** * Created by dimaer on 20/03/17. * La classe Core.SceneManager si occupa della gestione delle varie scene.Core.SceneManager ha il potere di cambiare * le scene da rappresentare. */ -public class SceneManager { +public final class SceneManager { - private List scenes; + private ArrayList scenes; private Scene currentScene; - public SceneManager(){ - scenes = new ArrayList(); + private SceneManager(){ + scenes = new ArrayList<>(); + } + + private static final SceneManager sceneManager = new SceneManager(); + + /** + * Metodo che torna l'istanza della classe + * @return instanza di SceneManager + */ + public static SceneManager getInstance(){ + return sceneManager; } /** @@ -34,24 +45,55 @@ public void addScene(Scene scene) * @param scene Tipo di scena */ public void setCurrentScene(Scene scene){ - /*for (Scene s : scenes){ - if(s.getSceneType()==scene){ - currentScene = s; - } - }*/ + currentScene = scene; } /** - * Funzione che disegna la scena - * @param graphics + * Metodo che imposta la scena corrente in base al tipo di scena + * @param sceneType tipo di scena + */ + public void setCurrentScene(Scene.SCENE_TYPE sceneType){ + for (Scene scene : scenes){ + if(scene.getSceneType()==sceneType){ + currentScene=scene; + return; + } + + } + } + + /** + * Metodo che torna la scena corrente + * @return scena corrente + */ + public Scene getCurrentScene() { + return currentScene; + } + + /** + *Metodo che invia l'evento di Mouse alla scena corrente + * @param mouseEvent evento di Mouse + */ + public void notifyObservers(MouseEvent mouseEvent){ + getCurrentScene().notifyObservers(mouseEvent); + } + + /** + *Metodo che torna l'insieme di scene che sono contenute in SceneManager + * @return + */ + public ArrayList getScenes(){ + return scenes; + } + + /** + * Metodo che disegna la scena + * @param graphics instanza di Graphics */ public void draw(Graphics graphics) { - /*for (Scene s : scenes) - { - s.draw(graphics); - }*/ + currentScene.draw(graphics); } } diff --git a/Core/Screen.java b/Core/Screen.java index f9856a1..c6ad1fa 100644 --- a/Core/Screen.java +++ b/Core/Screen.java @@ -4,86 +4,107 @@ * La classe principale di rendering */ -import Actors.Pawn; -import Components.Event.MouseObserver; -import Components.Graphics.Gui.*; -import Components.Graphics.Gui.Button; -import Components.Graphics.Sprite; import Scenes.Game; -import Terrain.Board; -import Utils.Log; +import Scenes.MainMenu; + import java.awt.*; -import java.awt.Rectangle; + import java.awt.event.MouseAdapter; import java.awt.event.MouseListener; import java.awt.event.MouseEvent; -import java.util.ArrayList; import java.util.Timer; import java.util.TimerTask; public class Screen extends Canvas{ - private int width,height; - private ArrayList observers; + + private int bufferWidth,bufferHeight; + + private Graphics bufferGraphics; + private Image bufferImage; SceneManager sceneManager; + + Scene game; Scene mainMenu; - Game game; - Board board; Timer timer; + /** + * Metodo che aggiunge MouseListener + * @param mouseListener MouseListener da aggiungere + */ @Override public synchronized void addMouseListener(MouseListener mouseListener) { super.addMouseListener(mouseListener); } - public Screen(int Width, int Height) + /** + * Costruttore di Screen + */ + public Screen() { + initMouseListeners(); game = new Game(); - /*game = new Scene(Scene.SCENE_TYPE.RUNNED_GAME); - mainMenu = new Scene(Scene.SCENE_TYPE.MAIN_MENU);*/ - sceneManager = new SceneManager(); + mainMenu = new MainMenu(); + + sceneManager = SceneManager.getInstance(); + sceneManager.addScene(game); - sceneManager.setCurrentScene(game); - observers = new ArrayList<>(); - //mainMenu.addElement(); - //board = new Board(new Point(400,-200),this,new Weather(Weather.WEATHER_TYPE.Summer)); - //game.addElement(board); - //pawn = new Pawn(board.getCells().get(0)); - width= Width; - height = Height; - timer=new Timer(); + sceneManager.addScene(mainMenu); + sceneManager.setCurrentScene(mainMenu); + + + /** Timer serve per aggiornare lo schermo perche da solo non si aggiorna*/ + timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { repaint(); - } - },1*1000,1*1000); - //button = new Button(); - //sprite = new Sprite(new Point(0,0)); - //sprite.setImage(ResourceLoader.getInstance().LoadResource("Earth_Grass_3","sprite")); + },1,1);////repaint viene chiamato ogni secondo; - /*button.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent mouseEvent) { - System.out.print("Clicked"); - } + } + + /** + * Reset di buffer + */ + public void resetBuffer(){ + bufferHeight = getSize().height; + bufferWidth = getSize().width; + + if(bufferImage!=null){ + bufferGraphics.dispose(); + bufferGraphics=null; + } + if(bufferImage!=null){ + bufferImage.flush(); + bufferImage=null; + } + + bufferImage = createImage(bufferWidth,bufferHeight); + bufferGraphics = bufferImage.getGraphics(); + } + + /** + * Metodo che disegna frame in buffer + * @param graphics instanza di Graphics + */ + public void paintBuffer(Graphics graphics){ + setBackground(new Color(255,255,255,255)); + + sceneManager.draw(graphics); - @Override - public void mouseEntered(MouseEvent mouseEvent) { - //System.out.print("Entered"); - } - });*/ } - /**Определить как concrete class*/ + /** + * Metodo che inizializza MouseListener principali + */ private void initMouseListeners() { addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent mouseEvent) { super.mouseClicked(mouseEvent); - NotifyObservers(mouseEvent , "MOUSE_CLICKED"); + NotifyObservers(mouseEvent); } }); @@ -91,38 +112,51 @@ public void mouseClicked(MouseEvent mouseEvent) { @Override public void mouseMoved(MouseEvent mouseEvent) { super.mouseMoved(mouseEvent); - NotifyObservers(mouseEvent,"MOUSE_MOVED"); + NotifyObservers(mouseEvent); } }); } - private void initScenes(){ - } - private void NotifyObservers(MouseEvent mouseEvent , String message) + /** + * Funzione che invia le notifiche ai observers di scena corrente di sceneManager + * @param mouseEvent evento da inviare + */ + private void NotifyObservers(MouseEvent mouseEvent) { - for(MouseObserver observer : observers) - { - observer.update(mouseEvent,message); - } + sceneManager.notifyObservers(mouseEvent); } + /** + *Metodo che disegna sullo schermo + * @param graphics instanza di Graphics + */ @Override public void paint(Graphics graphics) { + if(bufferWidth!=getSize().width || + bufferHeight!=getSize().height || + bufferImage==null || bufferGraphics==null) + resetBuffer(); - super.paint(graphics); - setBackground(new Color(255,255,255,255)); - //sprite.draw(graphics); - //board.draw(graphics); - sceneManager.draw(graphics); - //pawn.draw(graphics); - //Log.getInstance().showDepth(graphics,board.getCells()); - //Log.getInstance().showOrigins(graphics,pawn.getSprite()); - } + if(bufferGraphics!=null){ + bufferGraphics.clearRect(0,0,bufferWidth,bufferHeight); + paintBuffer(bufferGraphics); + graphics.drawImage(bufferImage,0,0,this); + + } + + + } + /** + * Metodo che aggiorna lo schermo + * @param graphics instanza di Graphics + */ @Override public void update(Graphics graphics) { - super.update(graphics); + paint(graphics); + sceneManager.getCurrentScene().Update(); + } diff --git a/Core/Weather.java b/Core/Weather.java index da98e64..5491caa 100644 --- a/Core/Weather.java +++ b/Core/Weather.java @@ -1,72 +1,94 @@ package Core; -import Components.Graphics.Drawable; - import java.util.ArrayList; import java.util.Timer; import java.util.TimerTask; /** * Created by dimaer on 31/03/17. + * Classe che gestisce l'entita' delle stagioni. */ public final class Weather { private WEATHER_TYPE currentType; - Timer timer; - ArrayList weatherObservers; + private Timer timer; + private ArrayList weatherObservers; + /** + *Costruttore + * @param weather + */ public Weather(WEATHER_TYPE weather){ weatherObservers = new ArrayList<>(); - currentType=weather; + currentType = weather; + + /*Aggironamento di stagione*/ timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { switchWeather(); notifyObservers(); - System.out.print(currentType.toString()+"\n"); } - },5*1000,5*1000); + },60*1000,60*1000); } - //private static Weather weather = new Weather(); - - /*public static Weather getInstance(){ - return weather; - }*/ + /** + * Metodo che porta le notifiche ad oservatori + */ public void notifyObservers(){ for(WeatherObserver w : weatherObservers) { w.setSprite(); } } + + /** + * Metodo che aggiunge oservatori al array + * @param weatherObserver osservatore da aggiungere + */ public void addWeatherObserver(WeatherObserver weatherObserver){ this.weatherObservers.add(weatherObserver); } + /** + * Setter per il tempo + * @param weatherType stagione + */ private void setWeather(WEATHER_TYPE weatherType){ currentType = weatherType; } + /** + * Metodo che cambia il tempo corrente + */ public void switchWeather(){ - if(currentType==WEATHER_TYPE.Autumn){ + if(currentType == WEATHER_TYPE.Autumn){ setWeather(WEATHER_TYPE.Winter); - return; - }if(currentType==WEATHER_TYPE.Winter){ + return;//Serve per uscire dal metodo + }if(currentType == WEATHER_TYPE.Winter){ setWeather(WEATHER_TYPE.Spring); return; - }if(currentType==WEATHER_TYPE.Spring){ + }if(currentType == WEATHER_TYPE.Spring){ setWeather(WEATHER_TYPE.Summer); return; - }if(currentType==WEATHER_TYPE.Summer) { + }if(currentType == WEATHER_TYPE.Summer) { setWeather(WEATHER_TYPE.Autumn); return; } } + /** + * Getter della stagione + * @return enum la stagione + */ public WEATHER_TYPE getWeather(){ return currentType; } + + /** + *Tipo di stagione + */ public enum WEATHER_TYPE{ Autumn,Winter,Spring,Summer } diff --git a/Core/WeatherObserver.java b/Core/WeatherObserver.java index d382002..267e9f0 100644 --- a/Core/WeatherObserver.java +++ b/Core/WeatherObserver.java @@ -2,7 +2,11 @@ /** * Created by dimaer on 05/04/17. + * Interfaccia che deve essere implementata dalle classi interessati nelle notifiche di cambiamento delle stagioni */ public interface WeatherObserver { + /** + *Metodo che imposta nuovo sprite + */ void setSprite(); } diff --git a/JavaDoc/Actors/Bishop.html b/JavaDoc/Actors/Bishop.html new file mode 100644 index 0000000..37280b7 --- /dev/null +++ b/JavaDoc/Actors/Bishop.html @@ -0,0 +1,274 @@ + + + + + +Bishop + + + + + + + + + + + + +
+
Actors
+

Class Bishop

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    MouseObserver, Drawable
    +
    +
    +
    +
    public class Bishop
    +extends Piece
    +
    Created by dimaer on 27/03/17.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Bishop

        +
        public Bishop(Cell cell,
        +              Team.TEAMTYPE teamtype)
        +
        Costruttore di Bishop
        +
        +
        Parameters:
        +
        cell - cella iniziale
        +
        teamtype - tipo di squadra
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Actors/King.html b/JavaDoc/Actors/King.html new file mode 100644 index 0000000..913f542 --- /dev/null +++ b/JavaDoc/Actors/King.html @@ -0,0 +1,274 @@ + + + + + +King + + + + + + + + + + + + +
+
Actors
+

Class King

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    MouseObserver, Drawable
    +
    +
    +
    +
    public class King
    +extends Piece
    +
    Created by dimaer on 27/03/17.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        King

        +
        public King(Cell cell,
        +            Team.TEAMTYPE teamtype)
        +
        Costruttore di King
        +
        +
        Parameters:
        +
        cell - cella iniziale
        +
        teamtype - tipo di squadra
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Actors/Knight.html b/JavaDoc/Actors/Knight.html new file mode 100644 index 0000000..9b8b26b --- /dev/null +++ b/JavaDoc/Actors/Knight.html @@ -0,0 +1,274 @@ + + + + + +Knight + + + + + + + + + + + + +
+
Actors
+

Class Knight

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    MouseObserver, Drawable
    +
    +
    +
    +
    public class Knight
    +extends Piece
    +
    Created by dimaer on 27/03/17.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Knight

        +
        public Knight(Cell cell,
        +              Team.TEAMTYPE teamtype)
        +
        Costruttore di Knight
        +
        +
        Parameters:
        +
        cell - cella iniziale
        +
        teamtype - tipo di squadrae
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Actors/Pawn.html b/JavaDoc/Actors/Pawn.html new file mode 100644 index 0000000..c7e573e --- /dev/null +++ b/JavaDoc/Actors/Pawn.html @@ -0,0 +1,286 @@ + + + + + +Pawn + + + + + + + + + + + + +
+
Actors
+

Class Pawn

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    MouseObserver, Drawable
    +
    +
    +
    +
    public class Pawn
    +extends Piece
    +
    Created by dimaer on 25/03/17.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Pawn

        +
        public Pawn()
        +
      • +
      + + + +
        +
      • +

        Pawn

        +
        public Pawn(Cell cell,
        +            Team.TEAMTYPE teamtype)
        +
        Costruttore di Pawn
        +
        +
        Parameters:
        +
        cell - cella iniziale
        +
        teamtype - tipo di squadra
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Actors/Piece.html b/JavaDoc/Actors/Piece.html new file mode 100644 index 0000000..519495c --- /dev/null +++ b/JavaDoc/Actors/Piece.html @@ -0,0 +1,517 @@ + + + + + +Piece + + + + + + + + + + + + +
+
Actors
+

Class Piece

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Piece

        +
        public Piece()
        +
        Costruttore di Piece
        +
      • +
      + + + +
        +
      • +

        Piece

        +
        public Piece(Cell cell,
        +             Team.TEAMTYPE team)
        +
        Costruttore di Piece
        +
        +
        Parameters:
        +
        cell - cella iniziale
        +
        team - tipo di squadra
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        Move

        +
        public void Move(Cell cell)
        +
        Metodo che sposta la piedina
        +
        +
        Parameters:
        +
        cell - cella della nuova posizione
        +
        +
      • +
      + + + +
        +
      • +

        setCurrentCell

        +
        public void setCurrentCell(Cell currentCell)
        +
        Metodo che imposta la cella corrente
        +
        +
        Parameters:
        +
        currentCell - cella da impostare
        +
        +
      • +
      + + + +
        +
      • +

        getCurrentCell

        +
        public Cell getCurrentCell()
        +
        Metodo che torna la cella corrente
        +
        +
        Returns:
        +
        cella corrente
        +
        +
      • +
      + + + +
        +
      • +

        getTeam

        +
        public Team.TEAMTYPE getTeam()
        +
        Metodo che torna tipo di squadra
        +
        +
        Returns:
        +
        tipo di squadra
        +
        +
      • +
      + + + +
        +
      • +

        setPosition

        +
        public void setPosition(java.awt.Point position)
        +
        Metodo che imposta la nuova posizione
        +
        +
        Overrides:
        +
        setPosition in class GameObject
        +
        Parameters:
        +
        position - nuova posizione
        +
        +
      • +
      + + + +
        +
      • +

        setSpriteOutline

        +
        protected void setSpriteOutline(java.lang.String Team,
        +                                java.lang.String id)
        +
        Metodo che carica sprite con pedina evidenziata
        +
        +
        Parameters:
        +
        Team - tipo di squadra
        +
        id - il nome di sprite specificato in Resources.xml
        +
        +
      • +
      + + + +
        +
      • +

        getSpriteOutline

        +
        public Sprite getSpriteOutline()
        +
        Metodo che torna sprite di pedina evidenziata
        +
        +
        Returns:
        +
        sprite di pedina evidenziata
        +
        +
      • +
      + + + +
        +
      • +

        draw

        +
        public void draw(java.awt.Graphics graphics)
        +
        Metodo che disgena la pedina
        +
        +
        Specified by:
        +
        draw in interface Drawable
        +
        Overrides:
        +
        draw in class GameObject
        +
        Parameters:
        +
        graphics - instanza di Graphics
        +
        +
      • +
      + + + +
        +
      • +

        setSelected

        +
        public void setSelected(boolean selected)
        +
        Metodo che imposta la selezione
        +
        +
        Overrides:
        +
        setSelected in class GameObject
        +
        Parameters:
        +
        selected -
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update(java.awt.event.MouseEvent mouseEvent)
        +
        Metodo che aggiorna la pedina
        +
        +
        Specified by:
        +
        update in interface MouseObserver
        +
        Overrides:
        +
        update in class GameObject
        +
        Parameters:
        +
        mouseEvent - evento di Mouse
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Actors/Queen.html b/JavaDoc/Actors/Queen.html new file mode 100644 index 0000000..730be4a --- /dev/null +++ b/JavaDoc/Actors/Queen.html @@ -0,0 +1,274 @@ + + + + + +Queen + + + + + + + + + + + + +
+
Actors
+

Class Queen

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    MouseObserver, Drawable
    +
    +
    +
    +
    public class Queen
    +extends Piece
    +
    Created by dimaer on 27/03/17.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Queen

        +
        public Queen(Cell cell,
        +             Team.TEAMTYPE teamtype)
        +
        Costruttore di Queen
        +
        +
        Parameters:
        +
        cell - cella iniziale
        +
        teamtype - tipo di squadra
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Actors/Rook.html b/JavaDoc/Actors/Rook.html new file mode 100644 index 0000000..8b1277d --- /dev/null +++ b/JavaDoc/Actors/Rook.html @@ -0,0 +1,274 @@ + + + + + +Rook + + + + + + + + + + + + +
+
Actors
+

Class Rook

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    MouseObserver, Drawable
    +
    +
    +
    +
    public class Rook
    +extends Piece
    +
    Created by dimaer on 27/03/17.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Rook

        +
        public Rook(Cell cell,
        +            Team.TEAMTYPE teamtype)
        +
        Costruttore di Rook
        +
        +
        Parameters:
        +
        cell - cella iniziale
        +
        teamtype - tipo di squadra
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Actors/Team.TEAMTYPE.html b/JavaDoc/Actors/Team.TEAMTYPE.html new file mode 100644 index 0000000..e586118 --- /dev/null +++ b/JavaDoc/Actors/Team.TEAMTYPE.html @@ -0,0 +1,343 @@ + + + + + +Team.TEAMTYPE + + + + + + + + + + + + +
+
Actors
+

Enum Team.TEAMTYPE

+
+
+
    +
  • java.lang.Object
  • +
  • + +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<Team.TEAMTYPE>
    +
    +
    +
    Enclosing class:
    +
    Team
    +
    +
    +
    +
    public static enum Team.TEAMTYPE
    +extends java.lang.Enum<Team.TEAMTYPE>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      Blue 
      Red 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static Team.TEAMTYPEvalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static Team.TEAMTYPE[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Team.TEAMTYPE[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Team.TEAMTYPE c : Team.TEAMTYPE.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Team.TEAMTYPE valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Actors/Team.html b/JavaDoc/Actors/Team.html new file mode 100644 index 0000000..719a9b3 --- /dev/null +++ b/JavaDoc/Actors/Team.html @@ -0,0 +1,448 @@ + + + + + +Team + + + + + + + + + + + + +
+
Actors
+

Class Team

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Actors.Team
    • +
    +
  • +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      static class Team.TEAMTYPE 
      +
    • +
    + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      (package private) Team.TEAMTYPEteamtype 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Team(Team.TEAMTYPE teamtype, + Board board) 
      +
    • +
    + + +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Team

        +
        public Team(Team.TEAMTYPE teamtype,
        +            Board board)
        +
        +
        Parameters:
        +
        teamtype -
        +
        board -
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getTeamSize

        +
        public int getTeamSize()
        +
        +
        Returns:
        +
        +
      • +
      + + + +
        +
      • +

        deleteMember

        +
        public void deleteMember(Piece member)
        +
        +
        Parameters:
        +
        member -
        +
        +
      • +
      + + + +
        +
      • +

        addMember

        +
        public void addMember(Piece member)
        +
        +
        Parameters:
        +
        member -
        +
        +
      • +
      + + + +
        +
      • +

        getMembers

        +
        public java.util.ArrayList<Piece> getMembers()
        +
        +
        Returns:
        +
        +
      • +
      + + + +
        +
      • +

        getTeamtype

        +
        public Team.TEAMTYPE getTeamtype()
        +
        +
        Returns:
        +
        +
      • +
      + + + +
        +
      • +

        draw

        +
        public void draw(java.awt.Graphics graphics)
        +
        Description copied from interface: Drawable
        +
        Metodo che disegna sul canvas
        +
        +
        Specified by:
        +
        draw in interface Drawable
        +
        Parameters:
        +
        graphics - instanza di Graphics
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update(java.awt.event.MouseEvent mouseEvent)
        +
        +
        Specified by:
        +
        update in interface MouseObserver
        +
        Parameters:
        +
        mouseEvent - evento di Mouse
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Actors/package-frame.html b/JavaDoc/Actors/package-frame.html new file mode 100644 index 0000000..efeffd2 --- /dev/null +++ b/JavaDoc/Actors/package-frame.html @@ -0,0 +1,31 @@ + + + + + +Actors + + + + + +

Actors

+
+

Classes

+ +

Enums

+ +
+ + diff --git a/JavaDoc/Actors/package-summary.html b/JavaDoc/Actors/package-summary.html new file mode 100644 index 0000000..e549866 --- /dev/null +++ b/JavaDoc/Actors/package-summary.html @@ -0,0 +1,199 @@ + + + + + +Actors + + + + + + + + + + + +
+

Package Actors

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Bishop +
    Created by dimaer on 27/03/17.
    +
    King +
    Created by dimaer on 27/03/17.
    +
    Knight +
    Created by dimaer on 27/03/17.
    +
    Pawn +
    Created by dimaer on 25/03/17.
    +
    Piece +
    Created by dimaer on 21/06/17.
    +
    Queen +
    Created by dimaer on 27/03/17.
    +
    Rook +
    Created by dimaer on 27/03/17.
    +
    Team +
    Created by dimaer on 31/03/17.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    Team.TEAMTYPE 
    +
  • +
+
+ + + + + + diff --git a/JavaDoc/Actors/package-tree.html b/JavaDoc/Actors/package-tree.html new file mode 100644 index 0000000..b1bcf03 --- /dev/null +++ b/JavaDoc/Actors/package-tree.html @@ -0,0 +1,161 @@ + + + + + +Actors Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package Actors

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    • +
    +
  • +
+
+ + + + + + diff --git a/JavaDoc/Components/Event/MouseObserver.html b/JavaDoc/Components/Event/MouseObserver.html new file mode 100644 index 0000000..e283ce6 --- /dev/null +++ b/JavaDoc/Components/Event/MouseObserver.html @@ -0,0 +1,228 @@ + + + + + +MouseObserver + + + + + + + + + + + + +
+
Components.Event
+

Interface MouseObserver

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        update

        +
        void update(java.awt.event.MouseEvent mouseEvent)
        +
        +
        Parameters:
        +
        mouseEvent -
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Components/Event/package-frame.html b/JavaDoc/Components/Event/package-frame.html new file mode 100644 index 0000000..7731d0c --- /dev/null +++ b/JavaDoc/Components/Event/package-frame.html @@ -0,0 +1,20 @@ + + + + + +Components.Event + + + + + +

Components.Event

+
+

Interfaces

+ +
+ + diff --git a/JavaDoc/Components/Event/package-summary.html b/JavaDoc/Components/Event/package-summary.html new file mode 100644 index 0000000..23ff387 --- /dev/null +++ b/JavaDoc/Components/Event/package-summary.html @@ -0,0 +1,142 @@ + + + + + +Components.Event + + + + + + + + + + + +
+

Package Components.Event

+
+
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    MouseObserver +
    Created by dimaer on 22/03/17.
    +
    +
  • +
+
+ + + + + + diff --git a/JavaDoc/Components/Event/package-tree.html b/JavaDoc/Components/Event/package-tree.html new file mode 100644 index 0000000..3f907e3 --- /dev/null +++ b/JavaDoc/Components/Event/package-tree.html @@ -0,0 +1,131 @@ + + + + + +Components.Event Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package Components.Event

+Package Hierarchies: + +
+
+

Interface Hierarchy

+ +
+ + + + + + diff --git a/JavaDoc/Components/Graphics/Drawable.html b/JavaDoc/Components/Graphics/Drawable.html new file mode 100644 index 0000000..aca3737 --- /dev/null +++ b/JavaDoc/Components/Graphics/Drawable.html @@ -0,0 +1,232 @@ + + + + + +Drawable + + + + + + + + + + + + +
+
Components.Graphics
+

Interface Drawable

+
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethod and Description
      voiddraw(java.awt.Graphics graphics) +
      Metodo che disegna sul canvas
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        draw

        +
        void draw(java.awt.Graphics graphics)
        +
        Metodo che disegna sul canvas
        +
        +
        Parameters:
        +
        graphics - instanza di Graphics
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Components/Graphics/Gui/Button.html b/JavaDoc/Components/Graphics/Gui/Button.html new file mode 100644 index 0000000..3f71416 --- /dev/null +++ b/JavaDoc/Components/Graphics/Gui/Button.html @@ -0,0 +1,374 @@ + + + + + +Button + + + + + + + + + + + + +
+
Components.Graphics.Gui
+

Class Button

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Components.Graphics.Gui.Button
    • +
    +
  • +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Button(java.awt.Rectangle BoundRect, + java.lang.String label) +
      Costruttore di Button
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidaddMouseListener(java.awt.event.MouseListener mouseListener) +
      Aggiunge MouseListener
      +
      voiddraw(java.awt.Graphics graphics) +
      Metodo che disegna il pulsante
      +
      voidsetBoundRect(java.awt.Rectangle BoundRect) +
      Metodo che imposta le dimensioni di rettangolo
      +
      voidsetLabel(java.lang.String label) +
      Metodo che imposta testo per il pulsante
      +
      voidupdate(java.awt.event.MouseEvent mouseEvent) +
      Metodo che aggiorna il componente quando esso riceve il messagio (L'evento)
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Button

        +
        public Button(java.awt.Rectangle BoundRect,
        +              java.lang.String label)
        +
        Costruttore di Button
        +
        +
        Parameters:
        +
        BoundRect - Dimensioni di rettangolo
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setLabel

        +
        public void setLabel(java.lang.String label)
        +
        Metodo che imposta testo per il pulsante
        +
        +
        Parameters:
        +
        label - testo
        +
        +
      • +
      + + + +
        +
      • +

        setBoundRect

        +
        public void setBoundRect(java.awt.Rectangle BoundRect)
        +
        Metodo che imposta le dimensioni di rettangolo
        +
        +
        Parameters:
        +
        BoundRect - Dimensioni di rettangolo
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update(java.awt.event.MouseEvent mouseEvent)
        +
        Metodo che aggiorna il componente quando esso riceve il messagio (L'evento)
        +
        +
        Specified by:
        +
        update in interface MouseObserver
        +
        Parameters:
        +
        mouseEvent - L'evento di mouse
        +
        +
      • +
      + + + +
        +
      • +

        addMouseListener

        +
        public void addMouseListener(java.awt.event.MouseListener mouseListener)
        +
        Aggiunge MouseListener
        +
        +
        Parameters:
        +
        mouseListener - MouseListener
        +
        +
      • +
      + + + +
        +
      • +

        draw

        +
        public void draw(java.awt.Graphics graphics)
        +
        Metodo che disegna il pulsante
        +
        +
        Specified by:
        +
        draw in interface Drawable
        +
        Parameters:
        +
        graphics - oggetto di classe Graphics
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Components/Graphics/Gui/Label.html b/JavaDoc/Components/Graphics/Gui/Label.html new file mode 100644 index 0000000..15c0b47 --- /dev/null +++ b/JavaDoc/Components/Graphics/Gui/Label.html @@ -0,0 +1,375 @@ + + + + + +Label + + + + + + + + + + + + +
+
Components.Graphics.Gui
+

Class Label

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Components.Graphics.Gui.Label
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Drawable
    +
    +
    +
    +
    public class Label
    +extends java.lang.Object
    +implements Drawable
    +
    Classe che descrive etichetta + Created by dimaer on 21/06/17.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Label(java.lang.String text, + java.awt.Point position) +
      Costruttore di Label
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voiddraw(java.awt.Graphics graphics) +
      Metodo che disegna etichetta
      +
      java.awt.PointgetPosition() +
      Metodo che torna la posizione sullo schermo
      +
      java.lang.StringgetText() +
      Metodo che torna il testo di etichetta
      +
      voidsetPosition(java.awt.Point position) +
      Metodo che imposta la posizione
      +
      voidsetText(java.lang.String text) +
      Metodo che imposta il testo a etichetta
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Label

        +
        public Label(java.lang.String text,
        +             java.awt.Point position)
        +
        Costruttore di Label
        +
        +
        Parameters:
        +
        text - testo di etichetta
        +
        position - posizione sullo schermo
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getPosition

        +
        public java.awt.Point getPosition()
        +
        Metodo che torna la posizione sullo schermo
        +
        +
        Returns:
        +
        posizione sullo schermo
        +
        +
      • +
      + + + +
        +
      • +

        setPosition

        +
        public void setPosition(java.awt.Point position)
        +
        Metodo che imposta la posizione
        +
        +
        Parameters:
        +
        position - posizione sullo schermo
        +
        +
      • +
      + + + +
        +
      • +

        getText

        +
        public java.lang.String getText()
        +
        Metodo che torna il testo di etichetta
        +
        +
        Returns:
        +
        il testo di etichetta
        +
        +
      • +
      + + + +
        +
      • +

        setText

        +
        public void setText(java.lang.String text)
        +
        Metodo che imposta il testo a etichetta
        +
        +
        Parameters:
        +
        text - testo da impostare
        +
        +
      • +
      + + + +
        +
      • +

        draw

        +
        public void draw(java.awt.Graphics graphics)
        +
        Metodo che disegna etichetta
        +
        +
        Specified by:
        +
        draw in interface Drawable
        +
        Parameters:
        +
        graphics - instanza di Graphics
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Components/Graphics/Gui/package-frame.html b/JavaDoc/Components/Graphics/Gui/package-frame.html new file mode 100644 index 0000000..b3ac915 --- /dev/null +++ b/JavaDoc/Components/Graphics/Gui/package-frame.html @@ -0,0 +1,21 @@ + + + + + +Components.Graphics.Gui + + + + + +

Components.Graphics.Gui

+
+

Classes

+ +
+ + diff --git a/JavaDoc/Components/Graphics/Gui/package-summary.html b/JavaDoc/Components/Graphics/Gui/package-summary.html new file mode 100644 index 0000000..bc6dc97 --- /dev/null +++ b/JavaDoc/Components/Graphics/Gui/package-summary.html @@ -0,0 +1,147 @@ + + + + + +Components.Graphics.Gui + + + + + + + + + + + +
+

Package Components.Graphics.Gui

+
+
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Button 
    Label +
    Classe che descrive etichetta + Created by dimaer on 21/06/17.
    +
    +
  • +
+
+ + + + + + diff --git a/JavaDoc/Components/Graphics/Gui/package-tree.html b/JavaDoc/Components/Graphics/Gui/package-tree.html new file mode 100644 index 0000000..5b7bb16 --- /dev/null +++ b/JavaDoc/Components/Graphics/Gui/package-tree.html @@ -0,0 +1,136 @@ + + + + + +Components.Graphics.Gui Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package Components.Graphics.Gui

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object + +
  • +
+
+ + + + + + diff --git a/JavaDoc/Components/Graphics/Sprite.html b/JavaDoc/Components/Graphics/Sprite.html new file mode 100644 index 0000000..3d6a977 --- /dev/null +++ b/JavaDoc/Components/Graphics/Sprite.html @@ -0,0 +1,590 @@ + + + + + +Sprite + + + + + + + + + + + + +
+
Components.Graphics
+

Class Sprite

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Components.Graphics.Sprite
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Drawable
    +
    +
    +
    +
    public class Sprite
    +extends java.lang.Object
    +implements Drawable
    +
    Created by dimaer on 20/03/17. + La classe Sprite rappresenta il componente principale di rendering
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      Sprite() +
      Costruttore di Sprite
      +
      Sprite(java.awt.Point position) +
      Costruttore che assegna ad ogni istanza la posizione iniziale
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voiddraw(java.awt.Graphics graphics) +
      Metodo che disegna sprite
      +
      java.awt.PointgetCenter() +
      Il metodo che calcola le coordinate del centro di sprite rispetto all'immagine
      +
      intgetDepth() +
      Metodo che torna l'ordine di rendering
      +
      java.io.FilegetFile() +
      Funzione che torna file di immagine
      +
      java.awt.image.BufferedImagegetImage() +
      Metodo che torna immagine impostata
      +
      java.awt.PointgetOrigin() +
      Metodo che torna le cooridinate d'origine
      +
      java.awt.PointgetPosition() +
      Metodo che torna la posizione corrente
      +
      booleanisContainPoint(java.awt.Point point) +
      Metodo che verifica se il punto sullo schermo e' contenuto nella regione di sprite
      +
      booleanisVisibility() +
      Metodo che torna flag di visibilita'
      +
      booleanperPixelCollision(java.awt.Point point) +
      Metodo che verifica se il punto sullo schermo e' sovrapposto sui pixel di sprite
      +
      voidsetDepth(int depth) +
      Metodo che imposta l'ordine di rendering
      +
      voidsetImage(java.lang.String path) +
      Metodo che assegna file di immagine al oggetto di tipo Image
      +
      voidsetOrigin(java.awt.Point origin) +
      Metodo che imposta le coordinate d'origine di sprite
      +
      voidsetPosition(java.awt.Point vector) +
      Il metodo che imposta la posizione di sprite sullo schermo
      +
      voidsetVisibility(boolean visibility) +
      Metodo che imposta la visibilita di sprite sullo schermo
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Sprite

        +
        public Sprite()
        +
        Costruttore di Sprite
        +
      • +
      + + + +
        +
      • +

        Sprite

        +
        public Sprite(java.awt.Point position)
        +
        Costruttore che assegna ad ogni istanza la posizione iniziale
        +
        +
        Parameters:
        +
        position - posizione di locazione di Components.Graphics.Sprite
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getFile

        +
        public java.io.File getFile()
        +
        Funzione che torna file di immagine
        +
        +
        Returns:
        +
        file di immagine
        +
        +
      • +
      + + + +
        +
      • +

        setImage

        +
        public void setImage(java.lang.String path)
        +
        Metodo che assegna file di immagine al oggetto di tipo Image
        +
        +
        Parameters:
        +
        path - indirizzo del file nel file system
        +
        +
      • +
      + + + +
        +
      • +

        getImage

        +
        public java.awt.image.BufferedImage getImage()
        +
        Metodo che torna immagine impostata
        +
        +
        Returns:
        +
        immagine impostata
        +
        +
      • +
      + + + +
        +
      • +

        getPosition

        +
        public java.awt.Point getPosition()
        +
        Metodo che torna la posizione corrente
        +
        +
        Returns:
        +
        vettore di posizione corrente
        +
        +
      • +
      + + + +
        +
      • +

        setPosition

        +
        public void setPosition(java.awt.Point vector)
        +
        Il metodo che imposta la posizione di sprite sullo schermo
        +
        +
        Parameters:
        +
        vector - la posizione da impostare
        +
        +
      • +
      + + + +
        +
      • +

        getCenter

        +
        public java.awt.Point getCenter()
        +
        Il metodo che calcola le coordinate del centro di sprite rispetto all'immagine
        +
        +
        Returns:
        +
        le coordinate dell centro
        +
        +
      • +
      + + + +
        +
      • +

        setOrigin

        +
        public void setOrigin(java.awt.Point origin)
        +
        Metodo che imposta le coordinate d'origine di sprite
        +
        +
        Parameters:
        +
        origin - le coordinate nuove d'origine
        +
        +
      • +
      + + + +
        +
      • +

        getOrigin

        +
        public java.awt.Point getOrigin()
        +
        Metodo che torna le cooridinate d'origine
        +
        +
        Returns:
        +
        coordinate d'origine
        +
        +
      • +
      + + + +
        +
      • +

        setVisibility

        +
        public void setVisibility(boolean visibility)
        +
        Metodo che imposta la visibilita di sprite sullo schermo
        +
        +
        Parameters:
        +
        visibility - flag di visibilita
        +
        +
      • +
      + + + +
        +
      • +

        isVisibility

        +
        public boolean isVisibility()
        +
        Metodo che torna flag di visibilita'
        +
        +
        Returns:
        +
        +
      • +
      + + + +
        +
      • +

        isContainPoint

        +
        public boolean isContainPoint(java.awt.Point point)
        +
        Metodo che verifica se il punto sullo schermo e' contenuto nella regione di sprite
        +
        +
        Parameters:
        +
        point - le coordinate del punto
        +
        Returns:
        +
        true se e' contenuto , false se il punto e' fuori
        +
        +
      • +
      + + + +
        +
      • +

        perPixelCollision

        +
        public boolean perPixelCollision(java.awt.Point point)
        +
        Metodo che verifica se il punto sullo schermo e' sovrapposto sui pixel di sprite
        +
        +
        Parameters:
        +
        point - le coordinate del punto
        +
        Returns:
        +
        true se e' contenuto , false se il punto e' fuori
        +
        +
      • +
      + + + +
        +
      • +

        getDepth

        +
        public int getDepth()
        +
        Metodo che torna l'ordine di rendering
        +
        +
        Returns:
        +
        ordine di render
        +
        +
      • +
      + + + +
        +
      • +

        setDepth

        +
        public void setDepth(int depth)
        +
        Metodo che imposta l'ordine di rendering
        +
        +
        Parameters:
        +
        depth - l'ordine di rendering da impostare
        +
        +
      • +
      + + + +
        +
      • +

        draw

        +
        public void draw(java.awt.Graphics graphics)
        +
        Metodo che disegna sprite
        +
        +
        Specified by:
        +
        draw in interface Drawable
        +
        Parameters:
        +
        graphics -
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Components/Graphics/package-frame.html b/JavaDoc/Components/Graphics/package-frame.html new file mode 100644 index 0000000..8c46e20 --- /dev/null +++ b/JavaDoc/Components/Graphics/package-frame.html @@ -0,0 +1,24 @@ + + + + + +Components.Graphics + + + + + +

Components.Graphics

+
+

Interfaces

+ +

Classes

+ +
+ + diff --git a/JavaDoc/Components/Graphics/package-summary.html b/JavaDoc/Components/Graphics/package-summary.html new file mode 100644 index 0000000..fbd89af --- /dev/null +++ b/JavaDoc/Components/Graphics/package-summary.html @@ -0,0 +1,160 @@ + + + + + +Components.Graphics + + + + + + + + + + + +
+

Package Components.Graphics

+
+
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    Drawable +
    Interfaccia principale per tutte le entita' che devono essere disegnati + Created by dimaer on 19/03/17.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Sprite +
    Created by dimaer on 20/03/17.
    +
    +
  • +
+
+ + + + + + diff --git a/JavaDoc/Components/Graphics/package-tree.html b/JavaDoc/Components/Graphics/package-tree.html new file mode 100644 index 0000000..c438397 --- /dev/null +++ b/JavaDoc/Components/Graphics/package-tree.html @@ -0,0 +1,139 @@ + + + + + +Components.Graphics Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package Components.Graphics

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • Components.Graphics.Sprite (implements Components.Graphics.Drawable)
    • +
    +
  • +
+

Interface Hierarchy

+ +
+ + + + + + diff --git a/JavaDoc/Core/GameObject.html b/JavaDoc/Core/GameObject.html new file mode 100644 index 0000000..15ec906 --- /dev/null +++ b/JavaDoc/Core/GameObject.html @@ -0,0 +1,575 @@ + + + + + +GameObject + + + + + + + + + + + + +
+
Core
+

Class GameObject

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Core.GameObject
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    MouseObserver, Drawable
    +
    +
    +
    Direct Known Subclasses:
    +
    Board, Cell, Piece
    +
    +
    +
    +
    public class GameObject
    +extends java.lang.Object
    +implements Drawable, MouseObserver
    +
    Created by dimaer on 24/03/17. + La classe base di tutti le entita' interattive
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      GameObject() +
      Costruttore di GameObject
      +
      GameObject(java.awt.Point position) +
      Costruttore di GameObject
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voiddraw(java.awt.Graphics graphics) +
      Metodo che disegna l'oggetto
      +
      java.awt.RectanglegetBoundRect() +
      Metodo getter della regione attiva di oggetto
      +
      java.awt.PointgetPosition() +
      Metodo gettere della posizione di oggetto
      +
      SpritegetSprite() +
      Metodo che torna sprite corrente
      +
      booleanisActive() +
      Metodo che torna flag
      +
      booleanisSelected() +
      Metodo che verifica se l'ogetto e' stato selezionate
      +
      booleanisVisibility() +
      Metodo che verifica se oggetto e' visibile
      +
      voidsetActive(boolean active) +
      Metodo che attiva GameObject
      +
      voidsetBoundRect(java.awt.Rectangle boundRect) +
      Metodo che imposta la regione attiva di oggetto
      +
      voidsetPosition(java.awt.Point position) +
      Metodo setter della posizione di oggetto
      +
      voidsetSelected(boolean selected) +
      Metodo che imposta se l'ogetto e' stato selezionato
      +
      voidsetSprite(Sprite sprite) +
      Metodo che imposta sprite
      +
      voidsetSprite(java.lang.String Team, + java.lang.String id) +
      Metodo che carica sprite dalla memmoria di massa
      +
      voidupdate(java.awt.event.MouseEvent mouseEvent) +
      Metodo viene invocato ad ogni evento di mouse
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GameObject

        +
        public GameObject()
        +
        Costruttore di GameObject
        +
      • +
      + + + +
        +
      • +

        GameObject

        +
        public GameObject(java.awt.Point position)
        +
        Costruttore di GameObject
        +
        +
        Parameters:
        +
        position - posizione iniziale
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setActive

        +
        public void setActive(boolean active)
        +
        Metodo che attiva GameObject
        +
        +
        Parameters:
        +
        active - flag
        +
        +
      • +
      + + + +
        +
      • +

        isActive

        +
        public boolean isActive()
        +
        Metodo che torna flag
        +
        +
        Returns:
        +
        true se GameObject e' attivo invece false
        +
        +
      • +
      + + + +
        +
      • +

        isVisibility

        +
        public boolean isVisibility()
        +
        Metodo che verifica se oggetto e' visibile
        +
        +
        Returns:
        +
        +
      • +
      + + + +
        +
      • +

        setPosition

        +
        public void setPosition(java.awt.Point position)
        +
        Metodo setter della posizione di oggetto
        +
        +
        Parameters:
        +
        position -
        +
        +
      • +
      + + + +
        +
      • +

        setBoundRect

        +
        public void setBoundRect(java.awt.Rectangle boundRect)
        +
        Metodo che imposta la regione attiva di oggetto
        +
        +
        Parameters:
        +
        boundRect - rettangolo della regione
        +
        +
      • +
      + + + +
        +
      • +

        setSprite

        +
        public void setSprite(java.lang.String Team,
        +                      java.lang.String id)
        +
        Metodo che carica sprite dalla memmoria di massa
        +
        +
        Parameters:
        +
        Team - Squadra
        +
        id - Nome di file che e' stato impostato in Resources.xml
        +
        +
      • +
      + + + +
        +
      • +

        setSprite

        +
        public void setSprite(Sprite sprite)
        +
        Metodo che imposta sprite
        +
        +
        Parameters:
        +
        sprite - sprite da impostare
        +
        +
      • +
      + + + +
        +
      • +

        getSprite

        +
        public Sprite getSprite()
        +
        Metodo che torna sprite corrente
        +
        +
        Returns:
        +
        sprite corrente
        +
        +
      • +
      + + + +
        +
      • +

        getPosition

        +
        public java.awt.Point getPosition()
        +
        Metodo gettere della posizione di oggetto
        +
        +
        Returns:
        +
        posizione corrente sullo schermo
        +
        +
      • +
      + + + +
        +
      • +

        getBoundRect

        +
        public java.awt.Rectangle getBoundRect()
        +
        Metodo getter della regione attiva di oggetto
        +
        +
        Returns:
        +
        rettangolo della regione
        +
        +
      • +
      + + + +
        +
      • +

        setSelected

        +
        public void setSelected(boolean selected)
        +
        Metodo che imposta se l'ogetto e' stato selezionato
        +
        +
        Parameters:
        +
        selected - flag
        +
        +
      • +
      + + + +
        +
      • +

        isSelected

        +
        public boolean isSelected()
        +
        Metodo che verifica se l'ogetto e' stato selezionate
        +
        +
        Returns:
        +
        flag
        +
        +
      • +
      + + + +
        +
      • +

        draw

        +
        public void draw(java.awt.Graphics graphics)
        +
        Metodo che disegna l'oggetto
        +
        +
        Specified by:
        +
        draw in interface Drawable
        +
        Parameters:
        +
        graphics - instanza di Graphics
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update(java.awt.event.MouseEvent mouseEvent)
        +
        Metodo viene invocato ad ogni evento di mouse
        +
        +
        Specified by:
        +
        update in interface MouseObserver
        +
        Parameters:
        +
        mouseEvent -
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Core/ResourceLoader.html b/JavaDoc/Core/ResourceLoader.html new file mode 100644 index 0000000..f7ff847 --- /dev/null +++ b/JavaDoc/Core/ResourceLoader.html @@ -0,0 +1,338 @@ + + + + + +ResourceLoader + + + + + + + + + + + + +
+
Core
+

Class ResourceLoader

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Core.ResourceLoader
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class ResourceLoader
    +extends java.lang.Object
    +
    Classe che carica le resource facendo parsing dei file resource.xml e levels.xml + Created by dimaer on 27/03/17.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.StringcheckAnnotation(char text) +
      Metodo che decodifica la stringa che contiene il livelo nel file levels.xml
      +
      static ResourceLoadergetInstance() +
      Metodo che torna l'istanza della classe
      +
      java.lang.StringloadLevel(java.lang.String id) +
      Carica la stringa con livello dal file levels.xml
      +
      java.lang.StringLoadSprite(java.lang.String Team, + java.lang.String id) +
      Metodo che cerca path dei sprite considerati
      +
      java.lang.StringLoadTile(java.lang.String weatherType, + java.lang.String id) +
      Metodo che cerca il path nella cartela di applicazione di immagini definiti nella cartela resource.xml
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInstance

        +
        public static ResourceLoader getInstance()
        +
        Metodo che torna l'istanza della classe
        +
        +
        Returns:
        +
        ResourceLoader
        +
        +
      • +
      + + + +
        +
      • +

        LoadTile

        +
        public java.lang.String LoadTile(java.lang.String weatherType,
        +                                 java.lang.String id)
        +
        Metodo che cerca il path nella cartela di applicazione di immagini definiti nella cartela resource.xml
        +
        +
        Parameters:
        +
        weatherType - stagione
        +
        id - nome di sprite
        +
        Returns:
        +
        path del file
        +
        +
      • +
      + + + +
        +
      • +

        LoadSprite

        +
        public java.lang.String LoadSprite(java.lang.String Team,
        +                                   java.lang.String id)
        +
        Metodo che cerca path dei sprite considerati
        +
        +
        Parameters:
        +
        Team - tipo di squadra
        +
        id - nome di sprite
        +
        Returns:
        +
        path del file
        +
        +
      • +
      + + + +
        +
      • +

        checkAnnotation

        +
        public java.lang.String checkAnnotation(char text)
        +
        Metodo che decodifica la stringa che contiene il livelo nel file levels.xml
        +
        +
        Parameters:
        +
        text - simbolo
        +
        Returns:
        +
        nome del sprite decodificato nel simbolo
        +
        +
      • +
      + + + +
        +
      • +

        loadLevel

        +
        public java.lang.String loadLevel(java.lang.String id)
        +
        Carica la stringa con livello dal file levels.xml
        +
        +
        Parameters:
        +
        id - identificativo di livello
        +
        Returns:
        +
        stringa contenente il livello codificato
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Core/Scene.SCENE_TYPE.html b/JavaDoc/Core/Scene.SCENE_TYPE.html new file mode 100644 index 0000000..1adc8e8 --- /dev/null +++ b/JavaDoc/Core/Scene.SCENE_TYPE.html @@ -0,0 +1,367 @@ + + + + + +Scene.SCENE_TYPE + + + + + + + + + + + + +
+
Core
+

Enum Scene.SCENE_TYPE

+
+
+
    +
  • java.lang.Object
  • +
  • + +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<Scene.SCENE_TYPE>
    +
    +
    +
    Enclosing class:
    +
    Scene
    +
    +
    +
    +
    public static enum Scene.SCENE_TYPE
    +extends java.lang.Enum<Scene.SCENE_TYPE>
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static Scene.SCENE_TYPEvalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static Scene.SCENE_TYPE[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Scene.SCENE_TYPE[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Scene.SCENE_TYPE c : Scene.SCENE_TYPE.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Scene.SCENE_TYPE valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Core/Scene.html b/JavaDoc/Core/Scene.html new file mode 100644 index 0000000..b53bdb9 --- /dev/null +++ b/JavaDoc/Core/Scene.html @@ -0,0 +1,508 @@ + + + + + +Scene + + + + + + + + + + + + +
+
Core
+

Class Scene

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Core.Scene
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    Game, MainMenu, Options, Statistics
    +
    +
    +
    +
    public abstract class Scene
    +extends java.lang.Object
    +
    Created by dimaer on 20/03/17. + La classe Core.Scene rappresenta il contenitore di oggetti che devono essere disegnati
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      static class Scene.SCENE_TYPE 
      +
    • +
    + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Scene() +
      Costruttore della scena
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidaddElement(Drawable element) +
      Aggiunge l'elemento in render coda della scene
      +
      voidarrange() +
      Metodo che esegue bubbleSort sui elementi di coda rendering
      +
      voiddraw(java.awt.Graphics graphics) +
      Disegna tutti i elementi che stanno nella coda
      +
      java.util.List<Drawable>getElements() +
      Torna elementi che stanno in coda di render
      +
      java.util.ArrayList<MouseObserver>getObservers() +
      Torna oggetti che sono interagiscono con il Mouse
      +
      Scene.SCENE_TYPEgetSceneType() +
      Metodo che torna il tipo di scena
      +
      abstract voidInit() +
      Metodo di inizializazzione della scena
      +
      voidnotifyObservers(java.awt.event.MouseEvent mouseEvent) +
      Metodo che invia l'evento di Mouse a tutti gli elementi di coda di render che sono interattivi con Mouse
      +
      voidsetSceneType(Scene.SCENE_TYPE sceneType) +
      Metodo che imposta tipo di scena
      +
      abstract voidUpdate() +
      Metodo di aggirnamento della scena
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Scene

        +
        public Scene()
        +
        Costruttore della scena
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        Init

        +
        public abstract void Init()
        +
        Metodo di inizializazzione della scena
        +
      • +
      + + + +
        +
      • +

        Update

        +
        public abstract void Update()
        +
        Metodo di aggirnamento della scena
        +
      • +
      + + + +
        +
      • +

        getObservers

        +
        public java.util.ArrayList<MouseObserver> getObservers()
        +
        Torna oggetti che sono interagiscono con il Mouse
        +
        +
        Returns:
        +
        insieme di ogetti
        +
        +
      • +
      + + + +
        +
      • +

        addElement

        +
        public void addElement(Drawable element)
        +
        Aggiunge l'elemento in render coda della scene
        +
        +
        Parameters:
        +
        element - elemento da aggiungere
        +
        +
      • +
      + + + +
        +
      • +

        getElements

        +
        public java.util.List<Drawable> getElements()
        +
        Torna elementi che stanno in coda di render
        +
        +
        Returns:
        +
        insieme di oggetti
        +
        +
      • +
      + + + +
        +
      • +

        notifyObservers

        +
        public void notifyObservers(java.awt.event.MouseEvent mouseEvent)
        +
        Metodo che invia l'evento di Mouse a tutti gli elementi di coda di render che sono interattivi con Mouse
        +
        +
        Parameters:
        +
        mouseEvent - evento di Mouse
        +
        +
      • +
      + + + +
        +
      • +

        arrange

        +
        public void arrange()
        +
        Metodo che esegue bubbleSort sui elementi di coda rendering
        +
      • +
      + + + +
        +
      • +

        getSceneType

        +
        public Scene.SCENE_TYPE getSceneType()
        +
        Metodo che torna il tipo di scena
        +
        +
        Returns:
        +
        SCENES il tipo di scena
        +
        +
      • +
      + + + +
        +
      • +

        setSceneType

        +
        public void setSceneType(Scene.SCENE_TYPE sceneType)
        +
        Metodo che imposta tipo di scena
        +
        +
        Parameters:
        +
        sceneType - il tipo di scena
        +
        +
      • +
      + + + +
        +
      • +

        draw

        +
        public void draw(java.awt.Graphics graphics)
        +
        Disegna tutti i elementi che stanno nella coda
        +
        +
        Parameters:
        +
        graphics - l'oggetto che si occupa di operazioni grafiche
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Core/SceneManager.html b/JavaDoc/Core/SceneManager.html new file mode 100644 index 0000000..3ad3db9 --- /dev/null +++ b/JavaDoc/Core/SceneManager.html @@ -0,0 +1,384 @@ + + + + + +SceneManager + + + + + + + + + + + + +
+
Core
+

Class SceneManager

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Core.SceneManager
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class SceneManager
    +extends java.lang.Object
    +
    Created by dimaer on 20/03/17. + La classe Core.SceneManager si occupa della gestione delle varie scene.Core.SceneManager ha il potere di cambiare + le scene da rappresentare.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidaddScene(Scene scene) +
      Funzione che aggiunge la scena ad contenitore di Core.SceneManager
      +
      voiddraw(java.awt.Graphics graphics) +
      Metodo che disegna la scena
      +
      ScenegetCurrentScene() +
      Metodo che torna la scena corrente
      +
      static SceneManagergetInstance() +
      Metodo che torna l'istanza della classe
      +
      java.util.ArrayList<Scene>getScenes() +
      Metodo che torna l'insieme di scene che sono contenute in SceneManager
      +
      voidnotifyObservers(java.awt.event.MouseEvent mouseEvent) +
      Metodo che invia l'evento di Mouse alla scena corrente
      +
      voidsetCurrentScene(Scene.SCENE_TYPE sceneType) +
      Metodo che imposta la scena corrente in base al tipo di scena
      +
      voidsetCurrentScene(Scene scene) +
      Funzione che imposta la scena corrente
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInstance

        +
        public static SceneManager getInstance()
        +
        Metodo che torna l'istanza della classe
        +
        +
        Returns:
        +
        instanza di SceneManager
        +
        +
      • +
      + + + +
        +
      • +

        addScene

        +
        public void addScene(Scene scene)
        +
        Funzione che aggiunge la scena ad contenitore di Core.SceneManager
        +
        +
        Parameters:
        +
        scene - la scena da aggiungere
        +
        +
      • +
      + + + +
        +
      • +

        setCurrentScene

        +
        public void setCurrentScene(Scene scene)
        +
        Funzione che imposta la scena corrente
        +
        +
        Parameters:
        +
        scene - Tipo di scena
        +
        +
      • +
      + + + +
        +
      • +

        setCurrentScene

        +
        public void setCurrentScene(Scene.SCENE_TYPE sceneType)
        +
        Metodo che imposta la scena corrente in base al tipo di scena
        +
        +
        Parameters:
        +
        sceneType - tipo di scena
        +
        +
      • +
      + + + +
        +
      • +

        getCurrentScene

        +
        public Scene getCurrentScene()
        +
        Metodo che torna la scena corrente
        +
        +
        Returns:
        +
        scena corrente
        +
        +
      • +
      + + + +
        +
      • +

        notifyObservers

        +
        public void notifyObservers(java.awt.event.MouseEvent mouseEvent)
        +
        Metodo che invia l'evento di Mouse alla scena corrente
        +
        +
        Parameters:
        +
        mouseEvent - evento di Mouse
        +
        +
      • +
      + + + +
        +
      • +

        getScenes

        +
        public java.util.ArrayList<Scene> getScenes()
        +
        Metodo che torna l'insieme di scene che sono contenute in SceneManager
        +
        +
        Returns:
        +
        +
      • +
      + + + +
        +
      • +

        draw

        +
        public void draw(java.awt.Graphics graphics)
        +
        Metodo che disegna la scena
        +
        +
        Parameters:
        +
        graphics - instanza di Graphics
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Core/Screen.html b/JavaDoc/Core/Screen.html new file mode 100644 index 0000000..12dccdf --- /dev/null +++ b/JavaDoc/Core/Screen.html @@ -0,0 +1,504 @@ + + + + + +Screen + + + + + + + + + + + + +
+
Core
+

Class Screen

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.awt.Component
    • +
    • +
        +
      • java.awt.Canvas
      • +
      • +
          +
        • Core.Screen
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
    +
    +
    +
    +
    public class Screen
    +extends java.awt.Canvas
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Canvas

        +java.awt.Canvas.AccessibleAWTCanvas
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Component

        +java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      (package private) Scenegame 
      (package private) ScenemainMenu 
      (package private) SceneManagersceneManager 
      (package private) java.util.Timertimer 
      +
        +
      • + + +

        Fields inherited from class java.awt.Component

        +accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • +
      +
        +
      • + + +

        Fields inherited from interface java.awt.image.ImageObserver

        +ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Screen() +
      Costuttore di Screen
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidaddMouseListener(java.awt.event.MouseListener mouseListener) +
      Metodo che aggiunge MouseListener
      +
      voidpaint(java.awt.Graphics graphics) +
      Metodo che disegna sullo schermo
      +
      voidpaintBuffer(java.awt.Graphics graphics) +
      Metodo che disegna frame in buffer
      +
      voidresetBuffer() +
      Reset di buffer
      +
      voidupdate(java.awt.Graphics graphics) +
      Metodo che aggiorna lo schermo
      +
      +
        +
      • + + +

        Methods inherited from class java.awt.Canvas

        +addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Component

        +action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Screen

        +
        public Screen()
        +
        Costuttore di Screen
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        addMouseListener

        +
        public void addMouseListener(java.awt.event.MouseListener mouseListener)
        +
        Metodo che aggiunge MouseListener
        +
        +
        Overrides:
        +
        addMouseListener in class java.awt.Component
        +
        Parameters:
        +
        mouseListener - MouseListener da aggiungere
        +
        +
      • +
      + + + +
        +
      • +

        resetBuffer

        +
        public void resetBuffer()
        +
        Reset di buffer
        +
      • +
      + + + +
        +
      • +

        paintBuffer

        +
        public void paintBuffer(java.awt.Graphics graphics)
        +
        Metodo che disegna frame in buffer
        +
        +
        Parameters:
        +
        graphics - instanza di Graphics
        +
        +
      • +
      + + + +
        +
      • +

        paint

        +
        public void paint(java.awt.Graphics graphics)
        +
        Metodo che disegna sullo schermo
        +
        +
        Overrides:
        +
        paint in class java.awt.Canvas
        +
        Parameters:
        +
        graphics - instanza di Graphics
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update(java.awt.Graphics graphics)
        +
        Metodo che aggiorna lo schermo
        +
        +
        Overrides:
        +
        update in class java.awt.Canvas
        +
        Parameters:
        +
        graphics - instanza di Graphics
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Core/Weather.WEATHER_TYPE.html b/JavaDoc/Core/Weather.WEATHER_TYPE.html new file mode 100644 index 0000000..853cf89 --- /dev/null +++ b/JavaDoc/Core/Weather.WEATHER_TYPE.html @@ -0,0 +1,368 @@ + + + + + +Weather.WEATHER_TYPE + + + + + + + + + + + + +
+
Core
+

Enum Weather.WEATHER_TYPE

+
+
+
    +
  • java.lang.Object
  • +
  • + +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<Weather.WEATHER_TYPE>
    +
    +
    +
    Enclosing class:
    +
    Weather
    +
    +
    +
    +
    public static enum Weather.WEATHER_TYPE
    +extends java.lang.Enum<Weather.WEATHER_TYPE>
    +
    Tipo di stagione
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      Autumn 
      Spring 
      Summer 
      Winter 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static Weather.WEATHER_TYPEvalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static Weather.WEATHER_TYPE[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Weather.WEATHER_TYPE[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Weather.WEATHER_TYPE c : Weather.WEATHER_TYPE.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Weather.WEATHER_TYPE valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Core/Weather.html b/JavaDoc/Core/Weather.html new file mode 100644 index 0000000..1c84e71 --- /dev/null +++ b/JavaDoc/Core/Weather.html @@ -0,0 +1,358 @@ + + + + + +Weather + + + + + + + + + + + + +
+
Core
+

Class Weather

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Core.Weather
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class Weather
    +extends java.lang.Object
    +
    Created by dimaer on 31/03/17. + Classe che gestisce l'entita' delle stagioni.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Weather

        +
        public Weather(Weather.WEATHER_TYPE weather)
        +
        Costruttore
        +
        +
        Parameters:
        +
        weather -
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        notifyObservers

        +
        public void notifyObservers()
        +
        Metodo che porta le notifiche ad oservatori
        +
      • +
      + + + +
        +
      • +

        addWeatherObserver

        +
        public void addWeatherObserver(WeatherObserver weatherObserver)
        +
        Metodo che aggiunge oservatori al array
        +
        +
        Parameters:
        +
        weatherObserver - osservatore da aggiungere
        +
        +
      • +
      + + + +
        +
      • +

        switchWeather

        +
        public void switchWeather()
        +
        Metodo che cambia il tempo corrente
        +
      • +
      + + + +
        +
      • +

        getWeather

        +
        public Weather.WEATHER_TYPE getWeather()
        +
        Getter della stagione
        +
        +
        Returns:
        +
        enum la stagione
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Core/WeatherObserver.html b/JavaDoc/Core/WeatherObserver.html new file mode 100644 index 0000000..8a751b1 --- /dev/null +++ b/JavaDoc/Core/WeatherObserver.html @@ -0,0 +1,228 @@ + + + + + +WeatherObserver + + + + + + + + + + + + +
+
Core
+

Interface WeatherObserver

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    Board
    +
    +
    +
    +
    public interface WeatherObserver
    +
    Created by dimaer on 05/04/17. + Interfaccia che deve essere implementata dalle classi interessati nelle notifiche di cambiamento delle stagioni
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setSprite

        +
        void setSprite()
        +
        Metodo che imposta nuovo sprite
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Core/package-frame.html b/JavaDoc/Core/package-frame.html new file mode 100644 index 0000000..5f13493 --- /dev/null +++ b/JavaDoc/Core/package-frame.html @@ -0,0 +1,34 @@ + + + + + +Core + + + + + +

Core

+ + + diff --git a/JavaDoc/Core/package-summary.html b/JavaDoc/Core/package-summary.html new file mode 100644 index 0000000..54f959f --- /dev/null +++ b/JavaDoc/Core/package-summary.html @@ -0,0 +1,209 @@ + + + + + +Core + + + + + + + + + + + +
+

Package Core

+
+
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    WeatherObserver +
    Created by dimaer on 05/04/17.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    GameObject +
    Created by dimaer on 24/03/17.
    +
    ResourceLoader +
    Classe che carica le resource facendo parsing dei file resource.xml e levels.xml + Created by dimaer on 27/03/17.
    +
    Scene +
    Created by dimaer on 20/03/17.
    +
    SceneManager +
    Created by dimaer on 20/03/17.
    +
    Screen 
    Weather +
    Created by dimaer on 31/03/17.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    Scene.SCENE_TYPE 
    Weather.WEATHER_TYPE +
    Tipo di stagione
    +
    +
  • +
+
+ + + + + + diff --git a/JavaDoc/Core/package-tree.html b/JavaDoc/Core/package-tree.html new file mode 100644 index 0000000..fb7f81b --- /dev/null +++ b/JavaDoc/Core/package-tree.html @@ -0,0 +1,165 @@ + + + + + +Core Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package Core

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object + +
  • +
+

Interface Hierarchy

+ +

Enum Hierarchy

+ +
+ + + + + + diff --git a/JavaDoc/Main.html b/JavaDoc/Main.html new file mode 100644 index 0000000..1854f27 --- /dev/null +++ b/JavaDoc/Main.html @@ -0,0 +1,268 @@ + + + + + +Main + + + + + + + + + + + + +
+

Class Main

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Main
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class Main
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Main() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Main

        +
        public Main()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Scenes/Game.html b/JavaDoc/Scenes/Game.html new file mode 100644 index 0000000..5afe7b0 --- /dev/null +++ b/JavaDoc/Scenes/Game.html @@ -0,0 +1,566 @@ + + + + + +Game + + + + + + + + + + + + +
+
Scenes
+

Class Game

+
+
+
    +
  • java.lang.Object
  • +
  • + +
  • +
+
+
    +
  • +
    +
    +
    public final class Game
    +extends Scene
    +
    Gioco + Created by dimaer on 17/05/17.
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Game

        +
        public Game()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        Init

        +
        public void Init()
        +
        Metodo che inizializza la scena
        +
        +
        Specified by:
        +
        Init in class Scene
        +
        +
      • +
      + + + +
        +
      • +

        getSelected

        +
        public MouseObserver getSelected(java.awt.event.MouseEvent mouseEvent)
        +
        Metodo che torna oggetto selezionato dal mouse
        +
        +
        Parameters:
        +
        mouseEvent - evento di Mouse
        +
        Returns:
        +
        ogetto selezionato
        +
        +
      • +
      + + + +
        +
      • +

        switchTeam

        +
        public void switchTeam()
        +
        Cambia la squadra corrente
        +
      • +
      + + + +
        +
      • +

        makeCellActive

        +
        public void makeCellActive(Piece piece)
        +
        Attiva le celle in base della pedina
        +
        +
        Parameters:
        +
        piece - pedina
        +
        +
      • +
      + + + +
        +
      • +

        disableCell

        +
        public void disableCell()
        +
        Disabilita' tutte le celle
        +
      • +
      + + + +
        +
      • +

        isValid

        +
        public boolean isValid(Cell cell)
        +
        Cerca se la cella e' vuota
        +
        +
        Parameters:
        +
        cell - cella da verificare
        +
        Returns:
        +
        true se la cella e' vuota altrimenti false
        +
        +
      • +
      + + + +
        +
      • +

        getPiece

        +
        public Piece getPiece(Cell cell)
        +
        Torna la pedina sulla cella specifica
        +
        +
        Parameters:
        +
        cell - cella da esaminare
        +
        Returns:
        +
        pedina
        +
        +
      • +
      + + + +
        +
      • +

        notifyObservers

        +
        public void notifyObservers(java.awt.event.MouseEvent mouseEvent)
        +
        Metodo che porta l'evento ai elementi di scene
        +
        +
        Overrides:
        +
        notifyObservers in class Scene
        +
        Parameters:
        +
        mouseEvent - evento di Mouse
        +
        +
      • +
      + + + +
        +
      • +

        Update

        +
        public void Update()
        +
        Aggiorna la scena
        +
        +
        Specified by:
        +
        Update in class Scene
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Scenes/MainMenu.html b/JavaDoc/Scenes/MainMenu.html new file mode 100644 index 0000000..6e34d79 --- /dev/null +++ b/JavaDoc/Scenes/MainMenu.html @@ -0,0 +1,325 @@ + + + + + +MainMenu + + + + + + + + + + + + +
+
Scenes
+

Class MainMenu

+
+
+
    +
  • java.lang.Object
  • +
  • + +
  • +
+
+
    +
  • +
    +
    +
    public class MainMenu
    +extends Scene
    +
    Menu Principale + Created by dimaer on 17/05/17.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        MainMenu

        +
        public MainMenu()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        Init

        +
        public void Init()
        +
        Metodo che inizializza la scena
        +
        +
        Specified by:
        +
        Init in class Scene
        +
        +
      • +
      + + + +
        +
      • +

        Update

        +
        public void Update()
        +
        Metodo che aggiorna la Scena
        +
        +
        Specified by:
        +
        Update in class Scene
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Scenes/Options.html b/JavaDoc/Scenes/Options.html new file mode 100644 index 0000000..ea71efe --- /dev/null +++ b/JavaDoc/Scenes/Options.html @@ -0,0 +1,325 @@ + + + + + +Options + + + + + + + + + + + + +
+
Scenes
+

Class Options

+
+
+
    +
  • java.lang.Object
  • +
  • + +
  • +
+
+
    +
  • +
    +
    +
    public class Options
    +extends Scene
    +
    Opzioni + Created by dimaer on 19/06/17.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Options

        +
        public Options()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        Init

        +
        public void Init()
        +
        Metodo che inizializza la scena
        +
        +
        Specified by:
        +
        Init in class Scene
        +
        +
      • +
      + + + +
        +
      • +

        Update

        +
        public void Update()
        +
        Metodo che aggiorna la Scena
        +
        +
        Specified by:
        +
        Update in class Scene
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Scenes/Statistics.html b/JavaDoc/Scenes/Statistics.html new file mode 100644 index 0000000..2f3ad28 --- /dev/null +++ b/JavaDoc/Scenes/Statistics.html @@ -0,0 +1,325 @@ + + + + + +Statistics + + + + + + + + + + + + +
+
Scenes
+

Class Statistics

+
+
+
    +
  • java.lang.Object
  • +
  • + +
  • +
+
+
    +
  • +
    +
    +
    public class Statistics
    +extends Scene
    +
    Statistica + Created by dimaer on 19/06/17.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Statistics

        +
        public Statistics()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        Init

        +
        public void Init()
        +
        Metodo che inizializza la scena
        +
        +
        Specified by:
        +
        Init in class Scene
        +
        +
      • +
      + + + +
        +
      • +

        Update

        +
        public void Update()
        +
        Metodo che aggiorna la Scena
        +
        +
        Specified by:
        +
        Update in class Scene
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Scenes/package-frame.html b/JavaDoc/Scenes/package-frame.html new file mode 100644 index 0000000..eb56130 --- /dev/null +++ b/JavaDoc/Scenes/package-frame.html @@ -0,0 +1,23 @@ + + + + + +Scenes + + + + + +

Scenes

+
+

Classes

+ +
+ + diff --git a/JavaDoc/Scenes/package-summary.html b/JavaDoc/Scenes/package-summary.html new file mode 100644 index 0000000..dac8336 --- /dev/null +++ b/JavaDoc/Scenes/package-summary.html @@ -0,0 +1,164 @@ + + + + + +Scenes + + + + + + + + + + + +
+

Package Scenes

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Game +
    Gioco + Created by dimaer on 17/05/17.
    +
    MainMenu +
    Menu Principale + Created by dimaer on 17/05/17.
    +
    Options +
    Opzioni + Created by dimaer on 19/06/17.
    +
    Statistics +
    Statistica + Created by dimaer on 19/06/17.
    +
    +
  • +
+
+ + + + + + diff --git a/JavaDoc/Scenes/package-tree.html b/JavaDoc/Scenes/package-tree.html new file mode 100644 index 0000000..3a1fae3 --- /dev/null +++ b/JavaDoc/Scenes/package-tree.html @@ -0,0 +1,142 @@ + + + + + +Scenes Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package Scenes

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/JavaDoc/Terrain/Board.html b/JavaDoc/Terrain/Board.html new file mode 100644 index 0000000..5aa9b29 --- /dev/null +++ b/JavaDoc/Terrain/Board.html @@ -0,0 +1,542 @@ + + + + + +Board + + + + + + + + + + + + +
+
Terrain
+

Class Board

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      (package private) java.util.ArrayList<Cell>cells 
      (package private) Cell[][]convertedCells 
      (package private) java.awt.Pointmouse 
      (package private) Weatherweather 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Board(java.awt.Point position, + Weather weather) +
      Costruttore di Board
      +
      +
    • +
    + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        cells

        +
        java.util.ArrayList<Cell> cells
        +
      • +
      + + + +
        +
      • +

        convertedCells

        +
        Cell[][] convertedCells
        +
      • +
      + + + + + + + +
        +
      • +

        mouse

        +
        java.awt.Point mouse
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Board

        +
        public Board(java.awt.Point position,
        +             Weather weather)
        +
        Costruttore di Board
        +
        +
        Parameters:
        +
        position - posizione di board sullo schermo
        +
        weather - instanza di ogetto di Weather
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setSprite

        +
        public void setSprite()
        +
        Metodo che aggiorna oservatori di Weather
        +
        +
        Specified by:
        +
        setSprite in interface WeatherObserver
        +
        +
      • +
      + + + +
        +
      • +

        getCell

        +
        public Cell getCell(int x,
        +                    int y)
        +
        Metodo che torna la cella di scachiera che e' contenuta nell array bidimensionale
        +
        +
        Parameters:
        +
        x - posizione orizzontale
        +
        y - posizione verticale
        +
        Returns:
        +
        cella di scachiera
        +
        +
      • +
      + + + +
        +
      • +

        getCell

        +
        public Cell getCell(int n,
        +                    char ch)
        +
        Metodo che torna la cella di scachiera in base alla codifica numerica
        +
        +
        Parameters:
        +
        n - numero di cella
        +
        ch - la lettera di cella
        +
        Returns:
        +
        cella di scachiera
        +
        +
      • +
      + + + +
        +
      • +

        getRow

        +
        public java.util.ArrayList<Cell> getRow(int n)
        +
        Metodo che torna la riga di scachiera
        +
        +
        Parameters:
        +
        n - il numero della riga
        +
        Returns:
        +
        l'insieme di celle contenute nella riga
        +
        +
      • +
      + + + +
        +
      • +

        getColumn

        +
        public java.util.ArrayList<Cell> getColumn(int n)
        +
        Metodo che torna la colonna di scachiera
        +
        +
        Parameters:
        +
        n - il numero della colonna
        +
        Returns:
        +
        l'insieme di celle contenute nella colonna
        +
        +
      • +
      + + + +
        +
      • +

        getCells

        +
        public java.util.ArrayList<Cell> getCells()
        +
        Metodo che torna l'insieme di celle
        +
        +
        Returns:
        +
        l'insieme di celle che compongono la scachiera
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update(java.awt.event.MouseEvent mouseEvent)
        +
        Metodo che aggiorna le celle
        +
        +
        Specified by:
        +
        update in interface MouseObserver
        +
        Overrides:
        +
        update in class GameObject
        +
        Parameters:
        +
        mouseEvent - evento di Mouse
        +
        +
      • +
      + + + +
        +
      • +

        draw

        +
        public void draw(java.awt.Graphics graphics)
        +
        Metodo che disegna la scachiera
        +
        +
        Specified by:
        +
        draw in interface Drawable
        +
        Overrides:
        +
        draw in class GameObject
        +
        Parameters:
        +
        graphics - instanza di Graphics
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Terrain/Cell.Type.html b/JavaDoc/Terrain/Cell.Type.html new file mode 100644 index 0000000..3722f19 --- /dev/null +++ b/JavaDoc/Terrain/Cell.Type.html @@ -0,0 +1,343 @@ + + + + + +Cell.Type + + + + + + + + + + + + +
+
Terrain
+

Enum Cell.Type

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<Cell.Type>
    • +
    • +
        +
      • Terrain.Cell.Type
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<Cell.Type>
    +
    +
    +
    Enclosing class:
    +
    Cell
    +
    +
    +
    +
    static enum Cell.Type
    +extends java.lang.Enum<Cell.Type>
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Summary

      + + + + + + + + + + + +
      Enum Constants 
      Enum Constant and Description
      TYPE1 
      TYPE2 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static Cell.TypevalueOf(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static Cell.Type[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Enum Constant Detail

      + + + +
        +
      • +

        TYPE1

        +
        public static final Cell.Type TYPE1
        +
      • +
      + + + +
        +
      • +

        TYPE2

        +
        public static final Cell.Type TYPE2
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static Cell.Type[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (Cell.Type c : Cell.Type.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static Cell.Type valueOf(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Terrain/Cell.html b/JavaDoc/Terrain/Cell.html new file mode 100644 index 0000000..78f41f0 --- /dev/null +++ b/JavaDoc/Terrain/Cell.html @@ -0,0 +1,452 @@ + + + + + +Cell + + + + + + + + + + + + +
+
Terrain
+

Class Cell

+
+
+ +
+ +
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      (package private) static class Cell.Type 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Cell(java.awt.Point position, + java.lang.String spriteType, + java.lang.String weatherType) +
      Costruttore di cella
      +
      +
    • +
    + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Cell

        +
        public Cell(java.awt.Point position,
        +            java.lang.String spriteType,
        +            java.lang.String weatherType)
        +
        Costruttore di cella
        +
        +
        Parameters:
        +
        position - posizione iniziale sullo scherma
        +
        spriteType - tipo di sprite
        +
        weatherType - il tipo di stagione
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCoord

        +
        public java.awt.Point getCoord()
        +
        Metodo che torna le coordinate della cella in base di scachiera
        +
        +
        Returns:
        +
        +
      • +
      + + + +
        +
      • +

        setType

        +
        public void setType(Cell.Type type)
        +
        Metodo che imposta il tipo di cella
        +
        +
        Parameters:
        +
        type - tipo di cella
        +
        +
      • +
      + + + +
        +
      • +

        getSpriteType

        +
        public java.lang.String getSpriteType()
        +
        Metodo che torna il topo di sprite
        +
        +
        Returns:
        +
        il tipo di sprite
        +
        +
      • +
      + + + +
        +
      • +

        setAtackable

        +
        public void setAtackable(boolean atackable)
        +
        Metodo che imposta se la cella e' attacabile
        +
        +
        Parameters:
        +
        atackable - flag
        +
        +
      • +
      + + + +
        +
      • +

        isAtackable

        +
        public boolean isAtackable()
        +
        Metodo che verifica se la cella e' attacabile
        +
        +
        Returns:
        +
        flag
        +
        +
      • +
      + + + +
        +
      • +

        update

        +
        public void update(java.awt.event.MouseEvent mouseEvent)
        +
        Aggiorna la cella
        +
        +
        Specified by:
        +
        update in interface MouseObserver
        +
        Overrides:
        +
        update in class GameObject
        +
        Parameters:
        +
        mouseEvent - evento di Mouse
        +
        +
      • +
      + + + +
        +
      • +

        draw

        +
        public void draw(java.awt.Graphics graphics)
        +
        Metodo che disegna la cella
        +
        +
        Specified by:
        +
        draw in interface Drawable
        +
        Overrides:
        +
        draw in class GameObject
        +
        Parameters:
        +
        graphics - instanza di Graphics
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Terrain/package-frame.html b/JavaDoc/Terrain/package-frame.html new file mode 100644 index 0000000..d454cd1 --- /dev/null +++ b/JavaDoc/Terrain/package-frame.html @@ -0,0 +1,25 @@ + + + + + +Terrain + + + + + +

Terrain

+
+

Classes

+ +

Enums

+ +
+ + diff --git a/JavaDoc/Terrain/package-summary.html b/JavaDoc/Terrain/package-summary.html new file mode 100644 index 0000000..b46608e --- /dev/null +++ b/JavaDoc/Terrain/package-summary.html @@ -0,0 +1,164 @@ + + + + + +Terrain + + + + + + + + + + + +
+

Package Terrain

+
+
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Board +
    Classe che descrive il tavolo da gioco + Created by dimaer on 27/03/17.
    +
    Cell +
    Created by dimaer on 27/03/17.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Enum Summary 
    EnumDescription
    Cell.Type 
    +
  • +
+
+ + + + + + diff --git a/JavaDoc/Terrain/package-tree.html b/JavaDoc/Terrain/package-tree.html new file mode 100644 index 0000000..931dd4b --- /dev/null +++ b/JavaDoc/Terrain/package-tree.html @@ -0,0 +1,152 @@ + + + + + +Terrain Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package Terrain

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    • +
    +
  • +
+
+ + + + + + diff --git a/JavaDoc/Utils/Log.html b/JavaDoc/Utils/Log.html new file mode 100644 index 0000000..7eb0602 --- /dev/null +++ b/JavaDoc/Utils/Log.html @@ -0,0 +1,281 @@ + + + + + +Log + + + + + + + + + + + + +
+
Utils
+

Class Log

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • Utils.Log
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class Log
    +extends java.lang.Object
    +
    Created by dimaer on 29/03/17.
    +
  • +
+
+
+
    +
  • + + +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        showDepth

        +
        public void showDepth(java.awt.Graphics graphics,
        +                      Sprite sprite)
        +
      • +
      + + + +
        +
      • +

        showDepth

        +
        public void showDepth(java.awt.Graphics graphics,
        +                      java.util.ArrayList<Cell> cells)
        +
      • +
      + + + +
        +
      • +

        showOrigins

        +
        public void showOrigins(java.awt.Graphics graphics,
        +                        Sprite sprite)
        +
      • +
      + + + +
        +
      • +

        getInstance

        +
        public static Log getInstance()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/JavaDoc/Utils/package-frame.html b/JavaDoc/Utils/package-frame.html new file mode 100644 index 0000000..0951b61 --- /dev/null +++ b/JavaDoc/Utils/package-frame.html @@ -0,0 +1,20 @@ + + + + + +Utils + + + + + +

Utils

+
+

Classes

+ +
+ + diff --git a/JavaDoc/Utils/package-summary.html b/JavaDoc/Utils/package-summary.html new file mode 100644 index 0000000..04845d8 --- /dev/null +++ b/JavaDoc/Utils/package-summary.html @@ -0,0 +1,142 @@ + + + + + +Utils + + + + + + + + + + + +
+

Package Utils

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Log +
    Created by dimaer on 29/03/17.
    +
    +
  • +
+
+ + + + + + diff --git a/JavaDoc/Utils/package-tree.html b/JavaDoc/Utils/package-tree.html new file mode 100644 index 0000000..840bfba --- /dev/null +++ b/JavaDoc/Utils/package-tree.html @@ -0,0 +1,135 @@ + + + + + +Utils Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package Utils

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object + +
  • +
+
+ + + + + + diff --git a/JavaDoc/allclasses-frame.html b/JavaDoc/allclasses-frame.html new file mode 100644 index 0000000..fca38b1 --- /dev/null +++ b/JavaDoc/allclasses-frame.html @@ -0,0 +1,49 @@ + + + + + +All Classes + + + + + +

All Classes

+ + + diff --git a/JavaDoc/allclasses-noframe.html b/JavaDoc/allclasses-noframe.html new file mode 100644 index 0000000..7e90050 --- /dev/null +++ b/JavaDoc/allclasses-noframe.html @@ -0,0 +1,49 @@ + + + + + +All Classes + + + + + +

All Classes

+ + + diff --git a/JavaDoc/constant-values.html b/JavaDoc/constant-values.html new file mode 100644 index 0000000..bf67fd9 --- /dev/null +++ b/JavaDoc/constant-values.html @@ -0,0 +1,122 @@ + + + + + +Constant Field Values + + + + + + + + + + + +
+

Constant Field Values

+

Contents

+
+ + + + + + diff --git a/JavaDoc/deprecated-list.html b/JavaDoc/deprecated-list.html new file mode 100644 index 0000000..82e49fc --- /dev/null +++ b/JavaDoc/deprecated-list.html @@ -0,0 +1,122 @@ + + + + + +Deprecated List + + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/help-doc.html b/JavaDoc/help-doc.html new file mode 100644 index 0000000..71d3ca0 --- /dev/null +++ b/JavaDoc/help-doc.html @@ -0,0 +1,223 @@ + + + + + +API Help + + + + + + + + +
+ + + + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    Overview

    +

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    +
  • +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-1.html b/JavaDoc/index-files/index-1.html new file mode 100644 index 0000000..49f9104 --- /dev/null +++ b/JavaDoc/index-files/index-1.html @@ -0,0 +1,153 @@ + + + + + +A-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

A

+
+
Actors - package Actors
+
 
+
addElement(Drawable) - Method in class Core.Scene
+
+
Aggiunge l'elemento in render coda della scene
+
+
addMember(Piece) - Method in class Actors.Team
+
 
+
addMouseListener(MouseListener) - Method in class Components.Graphics.Gui.Button
+
+
Aggiunge MouseListener
+
+
addMouseListener(MouseListener) - Method in class Core.Screen
+
+
Metodo che aggiunge MouseListener
+
+
addScene(Scene) - Method in class Core.SceneManager
+
+
Funzione che aggiunge la scena ad contenitore di Core.SceneManager
+
+
addWeatherObserver(WeatherObserver) - Method in class Core.Weather
+
+
Metodo che aggiunge oservatori al array
+
+
arrange() - Method in class Core.Scene
+
+
Metodo che esegue bubbleSort sui elementi di coda rendering
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-10.html b/JavaDoc/index-files/index-10.html new file mode 100644 index 0000000..3c9e0ab --- /dev/null +++ b/JavaDoc/index-files/index-10.html @@ -0,0 +1,141 @@ + + + + + +N-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

N

+
+
notifyObservers(MouseEvent) - Method in class Core.Scene
+
+
Metodo che invia l'evento di Mouse a tutti gli elementi di coda di render che sono interattivi con Mouse
+
+
notifyObservers(MouseEvent) - Method in class Core.SceneManager
+
+
Metodo che invia l'evento di Mouse alla scena corrente
+
+
notifyObservers() - Method in class Core.Weather
+
+
Metodo che porta le notifiche ad oservatori
+
+
notifyObservers(MouseEvent) - Method in class Scenes.Game
+
+
Metodo che porta l'evento ai elementi di scene
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-11.html b/JavaDoc/index-files/index-11.html new file mode 100644 index 0000000..456dfd6 --- /dev/null +++ b/JavaDoc/index-files/index-11.html @@ -0,0 +1,132 @@ + + + + + +O-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

O

+
+
Options - Class in Scenes
+
+
Opzioni + Created by dimaer on 19/06/17.
+
+
Options() - Constructor for class Scenes.Options
+
 
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-12.html b/JavaDoc/index-files/index-12.html new file mode 100644 index 0000000..f1c9b9c --- /dev/null +++ b/JavaDoc/index-files/index-12.html @@ -0,0 +1,159 @@ + + + + + +P-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

P

+
+
paint(Graphics) - Method in class Core.Screen
+
+
Metodo che disegna sullo schermo
+
+
paintBuffer(Graphics) - Method in class Core.Screen
+
+
Metodo che disegna frame in buffer
+
+
Pawn - Class in Actors
+
+
Created by dimaer on 25/03/17.
+
+
Pawn() - Constructor for class Actors.Pawn
+
 
+
Pawn(Cell, Team.TEAMTYPE) - Constructor for class Actors.Pawn
+
+
Costruttore di Pawn
+
+
perPixelCollision(Point) - Method in class Components.Graphics.Sprite
+
+
Metodo che verifica se il punto sullo schermo e' sovrapposto sui pixel di sprite
+
+
Piece - Class in Actors
+
+
Created by dimaer on 21/06/17.
+
+
Piece() - Constructor for class Actors.Piece
+
+
Costruttore di Piece
+
+
Piece(Cell, Team.TEAMTYPE) - Constructor for class Actors.Piece
+
+
Costruttore di Piece
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-13.html b/JavaDoc/index-files/index-13.html new file mode 100644 index 0000000..0d569ca --- /dev/null +++ b/JavaDoc/index-files/index-13.html @@ -0,0 +1,133 @@ + + + + + +Q-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

Q

+
+
Queen - Class in Actors
+
+
Created by dimaer on 27/03/17.
+
+
Queen(Cell, Team.TEAMTYPE) - Constructor for class Actors.Queen
+
+
Costruttore di Queen
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-14.html b/JavaDoc/index-files/index-14.html new file mode 100644 index 0000000..bb4b7a4 --- /dev/null +++ b/JavaDoc/index-files/index-14.html @@ -0,0 +1,142 @@ + + + + + +R-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

R

+
+
resetBuffer() - Method in class Core.Screen
+
+
Reset di buffer
+
+
ResourceLoader - Class in Core
+
+
Classe che carica le resource facendo parsing dei file resource.xml e levels.xml + Created by dimaer on 27/03/17.
+
+
Rook - Class in Actors
+
+
Created by dimaer on 27/03/17.
+
+
Rook(Cell, Team.TEAMTYPE) - Constructor for class Actors.Rook
+
+
Costruttore di Rook
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-15.html b/JavaDoc/index-files/index-15.html new file mode 100644 index 0000000..23f6003 --- /dev/null +++ b/JavaDoc/index-files/index-15.html @@ -0,0 +1,286 @@ + + + + + +S-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

S

+
+
Scene - Class in Core
+
+
Created by dimaer on 20/03/17.
+
+
Scene() - Constructor for class Core.Scene
+
+
Costruttore della scena
+
+
Scene.SCENE_TYPE - Enum in Core
+
 
+
SceneManager - Class in Core
+
+
Created by dimaer on 20/03/17.
+
+
sceneManager - Variable in class Core.Screen
+
 
+
Scenes - package Scenes
+
 
+
sceneType - Variable in class Core.Scene
+
 
+
Screen - Class in Core
+
 
+
Screen() - Constructor for class Core.Screen
+
+
Costuttore di Screen
+
+
selectedPiece - Variable in class Scenes.Game
+
 
+
selectedSprite - Variable in class Scenes.Game
+
 
+
setActive(boolean) - Method in class Core.GameObject
+
+
Metodo che attiva GameObject
+
+
setAtackable(boolean) - Method in class Terrain.Cell
+
+
Metodo che imposta se la cella e' attacabile
+
+
setBoundRect(Rectangle) - Method in class Components.Graphics.Gui.Button
+
+
Metodo che imposta le dimensioni di rettangolo
+
+
setBoundRect(Rectangle) - Method in class Core.GameObject
+
+
Metodo che imposta la regione attiva di oggetto
+
+
setCurrentCell(Cell) - Method in class Actors.Piece
+
+
Metodo che imposta la cella corrente
+
+
setCurrentScene(Scene) - Method in class Core.SceneManager
+
+
Funzione che imposta la scena corrente
+
+
setCurrentScene(Scene.SCENE_TYPE) - Method in class Core.SceneManager
+
+
Metodo che imposta la scena corrente in base al tipo di scena
+
+
setDepth(int) - Method in class Components.Graphics.Sprite
+
+
Metodo che imposta l'ordine di rendering
+
+
setImage(String) - Method in class Components.Graphics.Sprite
+
+
Metodo che assegna file di immagine al oggetto di tipo Image
+
+
setLabel(String) - Method in class Components.Graphics.Gui.Button
+
+
Metodo che imposta testo per il pulsante
+
+
setOrigin(Point) - Method in class Components.Graphics.Sprite
+
+
Metodo che imposta le coordinate d'origine di sprite
+
+
setPosition(Point) - Method in class Actors.Piece
+
+
Metodo che imposta la nuova posizione
+
+
setPosition(Point) - Method in class Components.Graphics.Gui.Label
+
+
Metodo che imposta la posizione
+
+
setPosition(Point) - Method in class Components.Graphics.Sprite
+
+
Il metodo che imposta la posizione di sprite sullo schermo
+
+
setPosition(Point) - Method in class Core.GameObject
+
+
Metodo setter della posizione di oggetto
+
+
setSceneType(Scene.SCENE_TYPE) - Method in class Core.Scene
+
+
Metodo che imposta tipo di scena
+
+
setSelected(boolean) - Method in class Actors.Piece
+
+
Metodo che imposta la selezione
+
+
setSelected(boolean) - Method in class Core.GameObject
+
+
Metodo che imposta se l'ogetto e' stato selezionato
+
+
setSprite(String, String) - Method in class Core.GameObject
+
+
Metodo che carica sprite dalla memmoria di massa
+
+
setSprite(Sprite) - Method in class Core.GameObject
+
+
Metodo che imposta sprite
+
+
setSprite() - Method in interface Core.WeatherObserver
+
+
Metodo che imposta nuovo sprite
+
+
setSprite() - Method in class Terrain.Board
+
+
Metodo che aggiorna oservatori di Weather
+
+
setSpriteOutline(String, String) - Method in class Actors.Piece
+
+
Metodo che carica sprite con pedina evidenziata
+
+
setText(String) - Method in class Components.Graphics.Gui.Label
+
+
Metodo che imposta il testo a etichetta
+
+
setType(Cell.Type) - Method in class Terrain.Cell
+
+
Metodo che imposta il tipo di cella
+
+
setVisibility(boolean) - Method in class Components.Graphics.Sprite
+
+
Metodo che imposta la visibilita di sprite sullo schermo
+
+
Sprite - Class in Components.Graphics
+
+
Created by dimaer on 20/03/17.
+
+
Sprite() - Constructor for class Components.Graphics.Sprite
+
+
Costruttore di Sprite
+
+
Sprite(Point) - Constructor for class Components.Graphics.Sprite
+
+
Costruttore che assegna ad ogni istanza la posizione iniziale
+
+
Statistics - Class in Scenes
+
+
Statistica + Created by dimaer on 19/06/17.
+
+
Statistics() - Constructor for class Scenes.Statistics
+
 
+
switchTeam() - Method in class Scenes.Game
+
+
Cambia la squadra corrente
+
+
switchWeather() - Method in class Core.Weather
+
+
Metodo che cambia il tempo corrente
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-16.html b/JavaDoc/index-files/index-16.html new file mode 100644 index 0000000..92f4a89 --- /dev/null +++ b/JavaDoc/index-files/index-16.html @@ -0,0 +1,139 @@ + + + + + +T-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

T

+
+
Team - Class in Actors
+
+
Created by dimaer on 31/03/17.
+
+
Team(Team.TEAMTYPE, Board) - Constructor for class Actors.Team
+
 
+
Team.TEAMTYPE - Enum in Actors
+
 
+
teamtype - Variable in class Actors.Team
+
 
+
Terrain - package Terrain
+
 
+
timer - Variable in class Core.Screen
+
 
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-17.html b/JavaDoc/index-files/index-17.html new file mode 100644 index 0000000..f4aa2ff --- /dev/null +++ b/JavaDoc/index-files/index-17.html @@ -0,0 +1,173 @@ + + + + + +U-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

U

+
+
update(MouseEvent) - Method in class Actors.Piece
+
+
Metodo che aggiorna la pedina
+
+
update(MouseEvent) - Method in class Actors.Team
+
 
+
update(MouseEvent) - Method in interface Components.Event.MouseObserver
+
 
+
update(MouseEvent) - Method in class Components.Graphics.Gui.Button
+
+
Metodo che aggiorna il componente quando esso riceve il messagio (L'evento)
+
+
update(MouseEvent) - Method in class Core.GameObject
+
+
Metodo viene invocato ad ogni evento di mouse
+
+
Update() - Method in class Core.Scene
+
+
Metodo di aggirnamento della scena
+
+
update(Graphics) - Method in class Core.Screen
+
+
Metodo che aggiorna lo schermo
+
+
Update() - Method in class Scenes.Game
+
+
Aggiorna la scena
+
+
Update() - Method in class Scenes.MainMenu
+
+
Metodo che aggiorna la Scena
+
+
Update() - Method in class Scenes.Options
+
+
Metodo che aggiorna la Scena
+
+
Update() - Method in class Scenes.Statistics
+
+
Metodo che aggiorna la Scena
+
+
update(MouseEvent) - Method in class Terrain.Board
+
+
Metodo che aggiorna le celle
+
+
update(MouseEvent) - Method in class Terrain.Cell
+
+
Aggiorna la cella
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-18.html b/JavaDoc/index-files/index-18.html new file mode 100644 index 0000000..69e2bbc --- /dev/null +++ b/JavaDoc/index-files/index-18.html @@ -0,0 +1,161 @@ + + + + + +V-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

V

+
+
valueOf(String) - Static method in enum Actors.Team.TEAMTYPE
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum Core.Scene.SCENE_TYPE
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum Core.Weather.WEATHER_TYPE
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum Terrain.Cell.Type
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum Actors.Team.TEAMTYPE
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum Core.Scene.SCENE_TYPE
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum Core.Weather.WEATHER_TYPE
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum Terrain.Cell.Type
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-19.html b/JavaDoc/index-files/index-19.html new file mode 100644 index 0000000..d09b0a8 --- /dev/null +++ b/JavaDoc/index-files/index-19.html @@ -0,0 +1,143 @@ + + + + + +W-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

W

+
+
Weather - Class in Core
+
+
Created by dimaer on 31/03/17.
+
+
Weather(Weather.WEATHER_TYPE) - Constructor for class Core.Weather
+
+
Costruttore
+
+
weather - Variable in class Terrain.Board
+
 
+
Weather.WEATHER_TYPE - Enum in Core
+
+
Tipo di stagione
+
+
WeatherObserver - Interface in Core
+
+
Created by dimaer on 05/04/17.
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-2.html b/JavaDoc/index-files/index-2.html new file mode 100644 index 0000000..444dac0 --- /dev/null +++ b/JavaDoc/index-files/index-2.html @@ -0,0 +1,150 @@ + + + + + +B-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

B

+
+
Bishop - Class in Actors
+
+
Created by dimaer on 27/03/17.
+
+
Bishop(Cell, Team.TEAMTYPE) - Constructor for class Actors.Bishop
+
+
Costruttore di Bishop
+
+
board - Variable in class Scenes.Game
+
 
+
Board - Class in Terrain
+
+
Classe che descrive il tavolo da gioco + Created by dimaer on 27/03/17.
+
+
Board(Point, Weather) - Constructor for class Terrain.Board
+
+
Costruttore di Board
+
+
Button - Class in Components.Graphics.Gui
+
 
+
Button(Rectangle, String) - Constructor for class Components.Graphics.Gui.Button
+
+
Costruttore di Button
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-3.html b/JavaDoc/index-files/index-3.html new file mode 100644 index 0000000..9f0ea7d --- /dev/null +++ b/JavaDoc/index-files/index-3.html @@ -0,0 +1,153 @@ + + + + + +C-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

C

+
+
Cell - Class in Terrain
+
+
Created by dimaer on 27/03/17.
+
+
Cell(Point, String, String) - Constructor for class Terrain.Cell
+
+
Costruttore di cella
+
+
Cell.Type - Enum in Terrain
+
 
+
cells - Variable in class Terrain.Board
+
 
+
checkAnnotation(char) - Method in class Core.ResourceLoader
+
+
Metodo che decodifica la stringa che contiene il livelo nel file levels.xml
+
+
Components.Event - package Components.Event
+
 
+
Components.Graphics - package Components.Graphics
+
 
+
Components.Graphics.Gui - package Components.Graphics.Gui
+
 
+
convertedCells - Variable in class Terrain.Board
+
 
+
Core - package Core
+
 
+
currentTurn - Variable in class Scenes.Game
+
 
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-4.html b/JavaDoc/index-files/index-4.html new file mode 100644 index 0000000..2a732a4 --- /dev/null +++ b/JavaDoc/index-files/index-4.html @@ -0,0 +1,178 @@ + + + + + +D-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

D

+
+
deleteMember(Piece) - Method in class Actors.Team
+
 
+
disableCell() - Method in class Scenes.Game
+
+
Disabilita' tutte le celle
+
+
draw(Graphics) - Method in class Actors.Piece
+
+
Metodo che disgena la pedina
+
+
draw(Graphics) - Method in class Actors.Team
+
 
+
draw(Graphics) - Method in interface Components.Graphics.Drawable
+
+
Metodo che disegna sul canvas
+
+
draw(Graphics) - Method in class Components.Graphics.Gui.Button
+
+
Metodo che disegna il pulsante
+
+
draw(Graphics) - Method in class Components.Graphics.Gui.Label
+
+
Metodo che disegna etichetta
+
+
draw(Graphics) - Method in class Components.Graphics.Sprite
+
+
Metodo che disegna sprite
+
+
draw(Graphics) - Method in class Core.GameObject
+
+
Metodo che disegna l'oggetto
+
+
draw(Graphics) - Method in class Core.Scene
+
+
Disegna tutti i elementi che stanno nella coda
+
+
draw(Graphics) - Method in class Core.SceneManager
+
+
Metodo che disegna la scena
+
+
draw(Graphics) - Method in class Terrain.Board
+
+
Metodo che disegna la scachiera
+
+
draw(Graphics) - Method in class Terrain.Cell
+
+
Metodo che disegna la cella
+
+
Drawable - Interface in Components.Graphics
+
+
Interfaccia principale per tutte le entita' che devono essere disegnati + Created by dimaer on 19/03/17.
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-5.html b/JavaDoc/index-files/index-5.html new file mode 100644 index 0000000..c245fb6 --- /dev/null +++ b/JavaDoc/index-files/index-5.html @@ -0,0 +1,276 @@ + + + + + +G-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

G

+
+
game - Variable in class Core.Screen
+
 
+
Game - Class in Scenes
+
+
Gioco + Created by dimaer on 17/05/17.
+
+
Game() - Constructor for class Scenes.Game
+
 
+
GameObject - Class in Core
+
+
Created by dimaer on 24/03/17.
+
+
GameObject() - Constructor for class Core.GameObject
+
+
Costruttore di GameObject
+
+
GameObject(Point) - Constructor for class Core.GameObject
+
+
Costruttore di GameObject
+
+
getBoundRect() - Method in class Core.GameObject
+
+
Metodo getter della regione attiva di oggetto
+
+
getCell(int, int) - Method in class Terrain.Board
+
+
Metodo che torna la cella di scachiera che e' contenuta nell array bidimensionale
+
+
getCell(int, char) - Method in class Terrain.Board
+
+
Metodo che torna la cella di scachiera in base alla codifica numerica
+
+
getCells() - Method in class Terrain.Board
+
+
Metodo che torna l'insieme di celle
+
+
getCenter() - Method in class Components.Graphics.Sprite
+
+
Il metodo che calcola le coordinate del centro di sprite rispetto all'immagine
+
+
getColumn(int) - Method in class Terrain.Board
+
+
Metodo che torna la colonna di scachiera
+
+
getCoord() - Method in class Terrain.Cell
+
+
Metodo che torna le coordinate della cella in base di scachiera
+
+
getCurrentCell() - Method in class Actors.Piece
+
+
Metodo che torna la cella corrente
+
+
getCurrentScene() - Method in class Core.SceneManager
+
+
Metodo che torna la scena corrente
+
+
getDepth() - Method in class Components.Graphics.Sprite
+
+
Metodo che torna l'ordine di rendering
+
+
getElements() - Method in class Core.Scene
+
+
Torna elementi che stanno in coda di render
+
+
getFile() - Method in class Components.Graphics.Sprite
+
+
Funzione che torna file di immagine
+
+
getImage() - Method in class Components.Graphics.Sprite
+
+
Metodo che torna immagine impostata
+
+
getInstance() - Static method in class Core.ResourceLoader
+
+
Metodo che torna l'istanza della classe
+
+
getInstance() - Static method in class Core.SceneManager
+
+
Metodo che torna l'istanza della classe
+
+
getMembers() - Method in class Actors.Team
+
 
+
getObservers() - Method in class Core.Scene
+
+
Torna oggetti che sono interagiscono con il Mouse
+
+
getOrigin() - Method in class Components.Graphics.Sprite
+
+
Metodo che torna le cooridinate d'origine
+
+
getPiece(Cell) - Method in class Scenes.Game
+
+
Torna la pedina sulla cella specifica
+
+
getPosition() - Method in class Components.Graphics.Gui.Label
+
+
Metodo che torna la posizione sullo schermo
+
+
getPosition() - Method in class Components.Graphics.Sprite
+
+
Metodo che torna la posizione corrente
+
+
getPosition() - Method in class Core.GameObject
+
+
Metodo gettere della posizione di oggetto
+
+
getRow(int) - Method in class Terrain.Board
+
+
Metodo che torna la riga di scachiera
+
+
getScenes() - Method in class Core.SceneManager
+
+
Metodo che torna l'insieme di scene che sono contenute in SceneManager
+
+
getSceneType() - Method in class Core.Scene
+
+
Metodo che torna il tipo di scena
+
+
getSelected(MouseEvent) - Method in class Scenes.Game
+
+
Metodo che torna oggetto selezionato dal mouse
+
+
getSprite() - Method in class Core.GameObject
+
+
Metodo che torna sprite corrente
+
+
getSpriteOutline() - Method in class Actors.Piece
+
+
Metodo che torna sprite di pedina evidenziata
+
+
getSpriteType() - Method in class Terrain.Cell
+
+
Metodo che torna il topo di sprite
+
+
getTeam() - Method in class Actors.Piece
+
+
Metodo che torna tipo di squadra
+
+
getTeamSize() - Method in class Actors.Team
+
 
+
getTeamtype() - Method in class Actors.Team
+
 
+
getText() - Method in class Components.Graphics.Gui.Label
+
+
Metodo che torna il testo di etichetta
+
+
getWeather() - Method in class Core.Weather
+
+
Getter della stagione
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-6.html b/JavaDoc/index-files/index-6.html new file mode 100644 index 0000000..1145638 --- /dev/null +++ b/JavaDoc/index-files/index-6.html @@ -0,0 +1,173 @@ + + + + + +I-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

I

+
+
Init() - Method in class Core.Scene
+
+
Metodo di inizializazzione della scena
+
+
Init() - Method in class Scenes.Game
+
+
Metodo che inizializza la scena
+
+
Init() - Method in class Scenes.MainMenu
+
+
Metodo che inizializza la scena
+
+
Init() - Method in class Scenes.Options
+
+
Metodo che inizializza la scena
+
+
Init() - Method in class Scenes.Statistics
+
+
Metodo che inizializza la scena
+
+
isActive() - Method in class Core.GameObject
+
+
Metodo che torna flag
+
+
isAtackable() - Method in class Terrain.Cell
+
+
Metodo che verifica se la cella e' attacabile
+
+
isContainPoint(Point) - Method in class Components.Graphics.Sprite
+
+
Metodo che verifica se il punto sullo schermo e' contenuto nella regione di sprite
+
+
isSelected() - Method in class Core.GameObject
+
+
Metodo che verifica se l'ogetto e' stato selezionate
+
+
isValid(Cell) - Method in class Scenes.Game
+
+
Cerca se la cella e' vuota
+
+
isVisibility() - Method in class Components.Graphics.Sprite
+
+
Metodo che torna flag di visibilita'
+
+
isVisibility() - Method in class Core.GameObject
+
+
Metodo che verifica se oggetto e' visibile
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-7.html b/JavaDoc/index-files/index-7.html new file mode 100644 index 0000000..4b775ff --- /dev/null +++ b/JavaDoc/index-files/index-7.html @@ -0,0 +1,141 @@ + + + + + +K-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

K

+
+
King - Class in Actors
+
+
Created by dimaer on 27/03/17.
+
+
King(Cell, Team.TEAMTYPE) - Constructor for class Actors.King
+
+
Costruttore di King
+
+
Knight - Class in Actors
+
+
Created by dimaer on 27/03/17.
+
+
Knight(Cell, Team.TEAMTYPE) - Constructor for class Actors.Knight
+
+
Costruttore di Knight
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-8.html b/JavaDoc/index-files/index-8.html new file mode 100644 index 0000000..b9cde32 --- /dev/null +++ b/JavaDoc/index-files/index-8.html @@ -0,0 +1,150 @@ + + + + + +L-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

L

+
+
Label - Class in Components.Graphics.Gui
+
+
Classe che descrive etichetta + Created by dimaer on 21/06/17.
+
+
Label(String, Point) - Constructor for class Components.Graphics.Gui.Label
+
+
Costruttore di Label
+
+
labelSeason - Variable in class Scenes.Game
+
 
+
labelTurn - Variable in class Scenes.Game
+
 
+
loadLevel(String) - Method in class Core.ResourceLoader
+
+
Carica la stringa con livello dal file levels.xml
+
+
LoadSprite(String, String) - Method in class Core.ResourceLoader
+
+
Metodo che cerca path dei sprite considerati
+
+
LoadTile(String, String) - Method in class Core.ResourceLoader
+
+
Metodo che cerca il path nella cartela di applicazione di immagini definiti nella cartela resource.xml
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index-files/index-9.html b/JavaDoc/index-files/index-9.html new file mode 100644 index 0000000..3403042 --- /dev/null +++ b/JavaDoc/index-files/index-9.html @@ -0,0 +1,154 @@ + + + + + +M-Index + + + + + + + + +
+ + + + + + + +
+ + +
A B C D G I K L M N O P Q R S T U V W  + + +

M

+
+
Main - Class in <Unnamed>
+
 
+
Main() - Constructor for class Main
+
 
+
main(String[]) - Static method in class Main
+
 
+
mainMenu - Variable in class Core.Screen
+
 
+
MainMenu - Class in Scenes
+
+
Menu Principale + Created by dimaer on 17/05/17.
+
+
MainMenu() - Constructor for class Scenes.MainMenu
+
 
+
makeCellActive(Piece) - Method in class Scenes.Game
+
+
Attiva le celle in base della pedina
+
+
mouse - Variable in class Terrain.Board
+
 
+
MouseObserver - Interface in Components.Event
+
+
Created by dimaer on 22/03/17.
+
+
Move(Cell) - Method in class Actors.Piece
+
+
Metodo che sposta la piedina
+
+
+A B C D G I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/index.html b/JavaDoc/index.html new file mode 100644 index 0000000..4da9802 --- /dev/null +++ b/JavaDoc/index.html @@ -0,0 +1,75 @@ + + + + + +Generated Documentation (Untitled) + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/JavaDoc/overview-frame.html b/JavaDoc/overview-frame.html new file mode 100644 index 0000000..57e9124 --- /dev/null +++ b/JavaDoc/overview-frame.html @@ -0,0 +1,28 @@ + + + + + +Overview List + + + + + + + +

 

+ + diff --git a/JavaDoc/overview-summary.html b/JavaDoc/overview-summary.html new file mode 100644 index 0000000..977c33a --- /dev/null +++ b/JavaDoc/overview-summary.html @@ -0,0 +1,157 @@ + + + + + +Overview + + + + + + + + +
+ + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Packages 
PackageDescription
Actors 
Components.Event 
Components.Graphics 
Components.Graphics.Gui 
Core 
Scenes 
Terrain 
+
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/overview-tree.html b/JavaDoc/overview-tree.html new file mode 100644 index 0000000..d5530b6 --- /dev/null +++ b/JavaDoc/overview-tree.html @@ -0,0 +1,202 @@ + + + + + +Class Hierarchy + + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Enum Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/JavaDoc/package-frame.html b/JavaDoc/package-frame.html new file mode 100644 index 0000000..51d6e20 --- /dev/null +++ b/JavaDoc/package-frame.html @@ -0,0 +1,20 @@ + + + + + +<Unnamed> + + + + + +

<Unnamed>

+
+

Classes

+ +
+ + diff --git a/JavaDoc/package-list b/JavaDoc/package-list new file mode 100644 index 0000000..9f19f2e --- /dev/null +++ b/JavaDoc/package-list @@ -0,0 +1,8 @@ + +Actors +Components.Event +Components.Graphics +Components.Graphics.Gui +Core +Scenes +Terrain diff --git a/JavaDoc/package-summary.html b/JavaDoc/package-summary.html new file mode 100644 index 0000000..6c9977f --- /dev/null +++ b/JavaDoc/package-summary.html @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + +
+

Package <Unnamed>

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Main 
    +
  • +
+
+ + + + + + diff --git a/JavaDoc/package-tree.html b/JavaDoc/package-tree.html new file mode 100644 index 0000000..bc9b068 --- /dev/null +++ b/JavaDoc/package-tree.html @@ -0,0 +1,135 @@ + + + + + + Class Hierarchy + + + + + + + + + + + +
+

Hierarchy For Package <Unnamed>

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object + +
  • +
+
+ + + + + + diff --git a/JavaDoc/script.js b/JavaDoc/script.js new file mode 100644 index 0000000..b346356 --- /dev/null +++ b/JavaDoc/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/JavaDoc/serialized-form.html b/JavaDoc/serialized-form.html new file mode 100644 index 0000000..f3fc182 --- /dev/null +++ b/JavaDoc/serialized-form.html @@ -0,0 +1,174 @@ + + + + + +Serialized Form + + + + + + + + + + + +
+

Serialized Form

+
+
+
    +
  • +

    Package Core

    +
      +
    • + + +

      Class Core.Screen extends java.awt.Canvas implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          bufferWidth

          +
          int bufferWidth
          +
        • +
        • +

          bufferHeight

          +
          int bufferHeight
          +
        • +
        • +

          bufferGraphics

          +
          java.awt.Graphics bufferGraphics
          +
        • +
        • +

          bufferImage

          +
          java.awt.Image bufferImage
          +
        • +
        • +

          sceneManager

          +
          SceneManager sceneManager
          +
        • +
        • +

          game

          +
          Scene game
          +
        • +
        • +

          mainMenu

          +
          Scene mainMenu
          +
        • +
        • +

          timer

          +
          java.util.Timer timer
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+ + + + + + diff --git a/JavaDoc/stylesheet.css b/JavaDoc/stylesheet.css new file mode 100644 index 0000000..98055b2 --- /dev/null +++ b/JavaDoc/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF new file mode 100644 index 0000000..37197ef --- /dev/null +++ b/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: Main + diff --git a/Main.java b/Main.java index afde889..b4c650d 100644 --- a/Main.java +++ b/Main.java @@ -11,15 +11,13 @@ public class Main { public static void main(String[] args) { - Screen screen = new Screen(1024,768); + Screen screen = new Screen(); System.out.print("Program Started"); Frame mainFrame = new Frame("ChessGame"); mainFrame.add(screen); - - - mainFrame.setSize(800,600); + mainFrame.setSize(1024,768); mainFrame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent windowEvent) { diff --git a/README.md b/README.md index 585e27e..acc0541 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # JavaChess +Subject:OOP|| +Universita' politecnica delle marche|| +Polytechnic university of Marche + diff --git a/Resources.xml b/Resources.xml index 376cd63..537dda2 100644 --- a/Resources.xml +++ b/Resources.xml @@ -23,43 +23,94 @@ - src/Sprites/Chess/Pawn1.png + src/Sprites/Chess/Red/Pawn.png + + src/Sprites/Chess/Red/Pawn_outline.png + + - + src/Sprites/Chess/Red/King.png + + src/Sprites/Chess/Red/King_outline.png + + - + src/Sprites/Chess/Red/Queen.png + + src/Sprites/Chess/Red/Queen_outline.png + + - src/Sprites/Chess/Rook.png + src/Sprites/Chess/Red/Rook.png + + + src/Sprites/Chess/Red/Rook_outline.png + - + src/Sprites/Chess/Red/Knight.png + + + src/Sprites/Chess/Red/Knight_outline.png + - src/Sprites/Chess/Bishop.png + src/Sprites/Chess/Red/Bishop.png + + + src/Sprites/Chess/Red/Bishop_outline.png - src/Sprites/Chess/Pawn1.png + src/Sprites/Chess/Pawn.png + + + + src/Sprites/Chess/Outline/Pawn_outline.png + - + src/Sprites/Chess/King.png + + + src/Sprites/Chess/Outline/King_outline.png + - + src/Sprites/Chess/Queen.png + + + src/Sprites/Chess/Outline/Queen_outline.png + + src/Sprites/Chess/Rook.png + + + src/Sprites/Chess/Outline/Rook_outline.png + + - + src/Sprites/Chess/Knight.png + + + + src/Sprites/Chess/Outline/Knight_outline.png + src/Sprites/Chess/Bishop.png + + + src/Sprites/Chess/Outline/Bishop_outline.png + diff --git a/Scenes/Game.java b/Scenes/Game.java index 67e0c07..d98c5f9 100644 --- a/Scenes/Game.java +++ b/Scenes/Game.java @@ -1,29 +1,255 @@ package Scenes; +import Actors.*; +import Components.Event.MouseObserver; +import Components.Graphics.Drawable; +import Components.Graphics.Gui.Label; +import Core.GameObject; import Core.Scene; +import Core.SceneManager; import Core.Weather; import Terrain.Board; +import Terrain.Cell; import java.awt.*; +import java.awt.event.MouseEvent; +import java.util.ArrayList; -/** +/** Gioco * Created by dimaer on 17/05/17. */ public final class Game extends Scene { - Board board; - /*public Game(SCENE_TYPE sceneType) { - super(sceneType); - }*/ + Board board; + Label labelTurn; + Label labelSeason; + MouseObserver selectedSprite; + Piece selectedPiece; + Team.TEAMTYPE currentTurn; + /** + * Metodo che inizializza la scena + */ @Override public void Init() { + + currentTurn = Team.TEAMTYPE.Blue; + setSceneType(SCENE_TYPE.RUNNED_GAME); - board = new Board(new Point(400,-200),new Weather(Weather.WEATHER_TYPE.Winter)); - addElement(board); + board = new Board(new Point(390,-300),new Weather(Weather.WEATHER_TYPE.Winter)); + + labelTurn = new Label("Turno di giocatore :",new Point(100,100)); + labelSeason = new Label("Stagione :",new Point(400,50)); + + for(Cell cell : board.getCells()) + addElement(cell); + + for (int i = 0 ;i<8;i++){ + Pawn pawn = new Pawn(board.getCell(6,(char)('a'+i)), Team.TEAMTYPE.Blue,board); + addElement(pawn); + } + + addElement(new Rook(board.getCell(7,'a'), Team.TEAMTYPE.Blue,board)); + addElement(new Knight(board.getCell(7,'b'), Team.TEAMTYPE.Blue,board)); + addElement(new Bishop(board.getCell(7,'c'), Team.TEAMTYPE.Blue,board)); + addElement(new Queen(board.getCell(7,'d'), Team.TEAMTYPE.Blue,board)); + addElement(new Bishop(board.getCell(7,'f'), Team.TEAMTYPE.Blue,board)); + addElement(new Knight(board.getCell(7,'g'), Team.TEAMTYPE.Blue,board)); + + addElement(new King(board.getCell(7,'e'), Team.TEAMTYPE.Blue,board)); + + addElement(new Rook(board.getCell(7,'h'), Team.TEAMTYPE.Blue,board)); + + + + addElement(new Rook(board.getCell(0,'a'), Team.TEAMTYPE.Red,board)); + addElement(new Knight(board.getCell(0,'b'), Team.TEAMTYPE.Red,board)); + addElement(new Bishop(board.getCell(0,'c'), Team.TEAMTYPE.Red,board)); + addElement(new Queen(board.getCell(0,'d'), Team.TEAMTYPE.Red,board)); + addElement(new Bishop(board.getCell(0,'f'), Team.TEAMTYPE.Red,board)); + addElement(new Knight(board.getCell(0,'g'), Team.TEAMTYPE.Red,board)); + + addElement(new King(board.getCell(0,'e'), Team.TEAMTYPE.Red,board)); + + addElement(new Rook(board.getCell(0,'h'), Team.TEAMTYPE.Red,board)); + + for(int i = 0;i<8;i++){ + Pawn pawn = new Pawn(board.getCell(1,(char)('a' + i)), Team.TEAMTYPE.Red,board); + addElement(pawn); + } + + addElement(labelTurn); + addElement(labelSeason); + + + } + + /** + *Metodo che torna oggetto selezionato dal mouse + * @param mouseEvent evento di Mouse + * @return ogetto selezionato + */ + public MouseObserver getSelected(MouseEvent mouseEvent){ + + ArrayList gameObjects = new ArrayList<>(); + + Point mouse = new Point(mouseEvent.getX(),mouseEvent.getY()); + + if(mouseEvent.getID()==MouseEvent.MOUSE_CLICKED) { + for (MouseObserver obs : getObservers()) { + GameObject gm = (GameObject) obs; + + if (gm.isActive()){ + if (gm.getSprite().perPixelCollision(mouse)) { + gameObjects.add(obs); + } + } + + } + int maxDepth = 0; + MouseObserver obs = null; + for (MouseObserver mouseObserver : gameObjects) { + + GameObject gm = (GameObject) mouseObserver; + + if (maxDepth < gm.getSprite().getDepth()) { + maxDepth = gm.getSprite().getDepth(); + obs = mouseObserver; + } + } + + + return obs; + } + return null; + } + /** + *Cambia la squadra corrente + */ + public void switchTeam(){ + if(currentTurn == Team.TEAMTYPE.Blue){ + currentTurn = Team.TEAMTYPE.Red; + }else + currentTurn = Team.TEAMTYPE.Blue; + } + + /** + *Attiva le celle in base della pedina + * @param piece pedina + */ + public void makeCellActive(Piece piece){ + + for(Cell cell : piece.getValidCells()){ + if(isValid(cell)){ + cell.setActive(true); + } + else { + Piece p = getPiece(cell); + + if(p.getTeam()!=piece.getTeam()){ + cell.setActive(true); + cell.setAtackable(true); + } + } + } + } + + /** + *Disabilita' tutte le celle + */ + public void disableCell(){ + for(Cell cell : board.getCells()){ + cell.setActive(false); + } + } + + /** + *Cerca se la cella e' vuota + * @param cell cella da verificare + * @return true se la cella e' vuota altrimenti false + */ + public boolean isValid(Cell cell){ + for(Drawable drawable : getElements()){ + if(drawable instanceof Piece){ + Piece piece = (Piece) drawable; + if(piece.getCurrentCell()==cell) + return false; + } + } + return true; + } + + /** + *Torna la pedina sulla cella specifica + * @param cell cella da esaminare + * @return pedina + */ + public Piece getPiece(Cell cell){ + for(Drawable drawable : getElements()){ + if(drawable instanceof Piece){ + Piece piece = (Piece) drawable; + if(piece.getCurrentCell()==cell) + return piece; + } + } + return null; + } + + /** + * Metodo che porta l'evento ai elementi di scene + * @param mouseEvent evento di Mouse + */ + @Override + public void notifyObservers(MouseEvent mouseEvent) { + selectedSprite = getSelected(mouseEvent); + GameObject gm = (GameObject) selectedSprite; + if(selectedSprite!=null && selectedSprite instanceof Piece) { + Piece p = (Piece) selectedSprite; + if (p.getTeam() == currentTurn) { + if (gm.isSelected()) + ((GameObject) selectedSprite).setSelected(false); //Polimorfismo + else { + gm.setSelected(true); + } + } + } + } + /** + * Aggiorna la scena + */ @Override public void Update() { + if(selectedSprite instanceof Piece) { + Piece piece = (Piece) selectedSprite; + + if(piece.isSelected()) { + makeCellActive((Piece) selectedSprite); + selectedPiece = piece; + } + else{ + disableCell(); + } + } + if(selectedSprite instanceof Cell){ + Cell cell = (Cell) selectedSprite; + selectedPiece.Move(cell); + if(cell.isAtackable()) { + Piece deathPiece = getPiece(cell); + if(deathPiece instanceof King){ + SceneManager.getInstance().setCurrentScene(SCENE_TYPE.MAIN_MENU); + } + getElements().remove(deathPiece); + cell.setAtackable(false); + } + switchTeam(); + disableCell(); + selectedSprite = null; + selectedPiece.setSelected(false); + selectedPiece = null; + + } + } } diff --git a/Scenes/MainMenu.java b/Scenes/MainMenu.java index 2be05c0..b8006db 100644 --- a/Scenes/MainMenu.java +++ b/Scenes/MainMenu.java @@ -1,16 +1,64 @@ package Scenes; +import Components.Graphics.Gui.Button; import Core.Scene; +import Core.SceneManager; -/** +import java.awt.*; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/**Menu Principale * Created by dimaer on 17/05/17. */ public class MainMenu extends Scene{ + /** + *Metodo che inizializza la scena + */ @Override public void Init() { + setSceneType(SCENE_TYPE.MAIN_MENU); + + Button play_btn= new Button(new Rectangle(350,100,100,50),"Play"); + Button stats_btn = new Button(new Rectangle(350,200,100,50),"Statistics"); + Button options_btn = new Button(new Rectangle(350,300,100,50),"Options"); + Button exit_btn = new Button(new Rectangle(350,400,100,50),"Exit"); + + play_btn.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + //System.out.println("clicked"); + SceneManager.getInstance().setCurrentScene(SCENE_TYPE.RUNNED_GAME); + } + }); + stats_btn.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + SceneManager.getInstance().setCurrentScene(SCENE_TYPE.STATS); + } + }); + exit_btn.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + System.exit(1); + } + }); + options_btn.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent mouseEvent) { + SceneManager.getInstance().setCurrentScene(SCENE_TYPE.OPTIONS); + } + }); + addElement(play_btn); + addElement(stats_btn); + addElement(exit_btn); + addElement(options_btn); } + /** + * Metodo che aggiorna la Scena + */ @Override public void Update() { diff --git a/Scenes/Options.java b/Scenes/Options.java new file mode 100644 index 0000000..1f89859 --- /dev/null +++ b/Scenes/Options.java @@ -0,0 +1,23 @@ +package Scenes; + +import Core.Scene; + +/**Opzioni + * Created by dimaer on 19/06/17. + */ +public class Options extends Scene { + /** + *Metodo che inizializza la scena + */ + @Override + public void Init() { + + } + /** + * Metodo che aggiorna la Scena + */ + @Override + public void Update() { + + } +} diff --git a/Scenes/Statistics.java b/Scenes/Statistics.java new file mode 100644 index 0000000..432b386 --- /dev/null +++ b/Scenes/Statistics.java @@ -0,0 +1,23 @@ +package Scenes; + +import Core.Scene; + +/**Statistica + * Created by dimaer on 19/06/17. + */ +public class Statistics extends Scene { + /** + *Metodo che inizializza la scena + */ + @Override + public void Init() { + + } + /** + * Metodo che aggiorna la Scena + */ + @Override + public void Update() { + + } +} diff --git a/Sprites/Chess/King.png b/Sprites/Chess/King.png new file mode 100644 index 0000000..8db6e3d Binary files /dev/null and b/Sprites/Chess/King.png differ diff --git a/Sprites/Chess/Knight.png b/Sprites/Chess/Knight.png new file mode 100644 index 0000000..580a678 Binary files /dev/null and b/Sprites/Chess/Knight.png differ diff --git a/Sprites/Chess/Outline.ver1/Bishop_outline.png b/Sprites/Chess/Outline.ver1/Bishop_outline.png new file mode 100644 index 0000000..1386b0f Binary files /dev/null and b/Sprites/Chess/Outline.ver1/Bishop_outline.png differ diff --git a/Sprites/Chess/Outline.ver1/King_outline.png b/Sprites/Chess/Outline.ver1/King_outline.png new file mode 100644 index 0000000..60e69b0 Binary files /dev/null and b/Sprites/Chess/Outline.ver1/King_outline.png differ diff --git a/Sprites/Chess/Outline.ver1/Knight_outline.png b/Sprites/Chess/Outline.ver1/Knight_outline.png new file mode 100644 index 0000000..09f0bf3 Binary files /dev/null and b/Sprites/Chess/Outline.ver1/Knight_outline.png differ diff --git a/Sprites/Chess/Outline.ver1/Pawn_outline.png b/Sprites/Chess/Outline.ver1/Pawn_outline.png new file mode 100644 index 0000000..b71dac5 Binary files /dev/null and b/Sprites/Chess/Outline.ver1/Pawn_outline.png differ diff --git a/Sprites/Chess/Outline.ver1/Queen_outline.png b/Sprites/Chess/Outline.ver1/Queen_outline.png new file mode 100644 index 0000000..5470bc8 Binary files /dev/null and b/Sprites/Chess/Outline.ver1/Queen_outline.png differ diff --git a/Sprites/Chess/Outline.ver1/Rock_outline.png b/Sprites/Chess/Outline.ver1/Rock_outline.png new file mode 100644 index 0000000..e4a486c Binary files /dev/null and b/Sprites/Chess/Outline.ver1/Rock_outline.png differ diff --git a/Sprites/Chess/Outline/Bishop_outline.png b/Sprites/Chess/Outline/Bishop_outline.png new file mode 100644 index 0000000..b974526 Binary files /dev/null and b/Sprites/Chess/Outline/Bishop_outline.png differ diff --git a/Sprites/Chess/Outline/King_outline.png b/Sprites/Chess/Outline/King_outline.png new file mode 100644 index 0000000..5902215 Binary files /dev/null and b/Sprites/Chess/Outline/King_outline.png differ diff --git a/Sprites/Chess/Outline/Knight_outline.png b/Sprites/Chess/Outline/Knight_outline.png new file mode 100644 index 0000000..b2b781f Binary files /dev/null and b/Sprites/Chess/Outline/Knight_outline.png differ diff --git a/Sprites/Chess/Outline/Pawn_outline.png b/Sprites/Chess/Outline/Pawn_outline.png new file mode 100644 index 0000000..c1ac97f Binary files /dev/null and b/Sprites/Chess/Outline/Pawn_outline.png differ diff --git a/Sprites/Chess/Outline/Queen_outline.png b/Sprites/Chess/Outline/Queen_outline.png new file mode 100644 index 0000000..5261b7c Binary files /dev/null and b/Sprites/Chess/Outline/Queen_outline.png differ diff --git a/Sprites/Chess/Outline/Rook_outline.png b/Sprites/Chess/Outline/Rook_outline.png new file mode 100644 index 0000000..ed4a438 Binary files /dev/null and b/Sprites/Chess/Outline/Rook_outline.png differ diff --git a/Sprites/Chess/Pawn1.png b/Sprites/Chess/Pawn.png similarity index 100% rename from Sprites/Chess/Pawn1.png rename to Sprites/Chess/Pawn.png diff --git a/Sprites/Chess/Queen.png b/Sprites/Chess/Queen.png new file mode 100644 index 0000000..e9623e1 Binary files /dev/null and b/Sprites/Chess/Queen.png differ diff --git a/Sprites/Chess/Red/Bishop.png b/Sprites/Chess/Red/Bishop.png new file mode 100644 index 0000000..c0dd152 Binary files /dev/null and b/Sprites/Chess/Red/Bishop.png differ diff --git a/Sprites/Chess/Red/Bishop_outline.png b/Sprites/Chess/Red/Bishop_outline.png new file mode 100644 index 0000000..c0b2ffc Binary files /dev/null and b/Sprites/Chess/Red/Bishop_outline.png differ diff --git a/Sprites/Chess/Red/King.png b/Sprites/Chess/Red/King.png new file mode 100644 index 0000000..5720f25 Binary files /dev/null and b/Sprites/Chess/Red/King.png differ diff --git a/Sprites/Chess/Red/King_outline.png b/Sprites/Chess/Red/King_outline.png new file mode 100644 index 0000000..d5c371c Binary files /dev/null and b/Sprites/Chess/Red/King_outline.png differ diff --git a/Sprites/Chess/Red/Knight.png b/Sprites/Chess/Red/Knight.png new file mode 100644 index 0000000..fe170ac Binary files /dev/null and b/Sprites/Chess/Red/Knight.png differ diff --git a/Sprites/Chess/Red/Knight_outline.png b/Sprites/Chess/Red/Knight_outline.png new file mode 100644 index 0000000..612ea6e Binary files /dev/null and b/Sprites/Chess/Red/Knight_outline.png differ diff --git a/Sprites/Chess/Red/Pawn.png b/Sprites/Chess/Red/Pawn.png new file mode 100644 index 0000000..8fab85e Binary files /dev/null and b/Sprites/Chess/Red/Pawn.png differ diff --git a/Sprites/Chess/Red/Pawn_outline.png b/Sprites/Chess/Red/Pawn_outline.png new file mode 100644 index 0000000..82c0cd5 Binary files /dev/null and b/Sprites/Chess/Red/Pawn_outline.png differ diff --git a/Sprites/Chess/Red/Queen.png b/Sprites/Chess/Red/Queen.png new file mode 100644 index 0000000..4dcd02d Binary files /dev/null and b/Sprites/Chess/Red/Queen.png differ diff --git a/Sprites/Chess/Red/Queen_outline.png b/Sprites/Chess/Red/Queen_outline.png new file mode 100644 index 0000000..88459ea Binary files /dev/null and b/Sprites/Chess/Red/Queen_outline.png differ diff --git a/Sprites/Chess/Red/Rook.png b/Sprites/Chess/Red/Rook.png new file mode 100644 index 0000000..d0bbdf3 Binary files /dev/null and b/Sprites/Chess/Red/Rook.png differ diff --git a/Sprites/Chess/Red/Rook_outline.png b/Sprites/Chess/Red/Rook_outline.png new file mode 100644 index 0000000..098a49c Binary files /dev/null and b/Sprites/Chess/Red/Rook_outline.png differ diff --git a/Sprites/Tiles/Autumn/Earth_Grass_1.png b/Sprites/Tiles/Autumn/Earth_Grass_1.png index f5d6d57..8d83307 100644 Binary files a/Sprites/Tiles/Autumn/Earth_Grass_1.png and b/Sprites/Tiles/Autumn/Earth_Grass_1.png differ diff --git a/Sprites/Tiles/Autumn/Earth_Grass_1_outline.png b/Sprites/Tiles/Autumn/Earth_Grass_1_outline.png new file mode 100644 index 0000000..f163f59 Binary files /dev/null and b/Sprites/Tiles/Autumn/Earth_Grass_1_outline.png differ diff --git a/Sprites/Tiles/Autumn/Earth_Grass_2.png b/Sprites/Tiles/Autumn/Earth_Grass_2.png index 816b711..fcab5c8 100644 Binary files a/Sprites/Tiles/Autumn/Earth_Grass_2.png and b/Sprites/Tiles/Autumn/Earth_Grass_2.png differ diff --git a/Sprites/Tiles/Autumn/Earth_Grass_2_outline.png b/Sprites/Tiles/Autumn/Earth_Grass_2_outline.png new file mode 100644 index 0000000..fa8523d Binary files /dev/null and b/Sprites/Tiles/Autumn/Earth_Grass_2_outline.png differ diff --git a/Sprites/Tiles/Autumn/Earth_Rock_1.png b/Sprites/Tiles/Autumn/Earth_Rock_1.png index 6422d69..cc7c0bc 100644 Binary files a/Sprites/Tiles/Autumn/Earth_Rock_1.png and b/Sprites/Tiles/Autumn/Earth_Rock_1.png differ diff --git a/Sprites/Tiles/Autumn/Earth_Rock_1_outline.png b/Sprites/Tiles/Autumn/Earth_Rock_1_outline.png new file mode 100644 index 0000000..6f34811 Binary files /dev/null and b/Sprites/Tiles/Autumn/Earth_Rock_1_outline.png differ diff --git a/Sprites/Tiles/Spring/Earth_Grass_1.png b/Sprites/Tiles/Spring/Earth_Grass_1.png new file mode 100644 index 0000000..7893161 Binary files /dev/null and b/Sprites/Tiles/Spring/Earth_Grass_1.png differ diff --git a/Sprites/Tiles/Spring/Earth_Grass_1_outline.png b/Sprites/Tiles/Spring/Earth_Grass_1_outline.png new file mode 100644 index 0000000..6be20f8 Binary files /dev/null and b/Sprites/Tiles/Spring/Earth_Grass_1_outline.png differ diff --git a/Sprites/Tiles/Spring/Earth_Grass_2.png b/Sprites/Tiles/Spring/Earth_Grass_2.png new file mode 100644 index 0000000..305937c Binary files /dev/null and b/Sprites/Tiles/Spring/Earth_Grass_2.png differ diff --git a/Sprites/Tiles/Spring/Earth_Grass_2_outline.png b/Sprites/Tiles/Spring/Earth_Grass_2_outline.png new file mode 100644 index 0000000..d697686 Binary files /dev/null and b/Sprites/Tiles/Spring/Earth_Grass_2_outline.png differ diff --git a/Sprites/Tiles/Spring/Earth_Grass_3.png b/Sprites/Tiles/Spring/Earth_Grass_3.png new file mode 100644 index 0000000..e8beb06 Binary files /dev/null and b/Sprites/Tiles/Spring/Earth_Grass_3.png differ diff --git a/Sprites/Tiles/Spring/Earth_Grass_3_outline.png b/Sprites/Tiles/Spring/Earth_Grass_3_outline.png new file mode 100644 index 0000000..2b13065 Binary files /dev/null and b/Sprites/Tiles/Spring/Earth_Grass_3_outline.png differ diff --git a/Sprites/Tiles/Spring/Earth_Rock_1.png b/Sprites/Tiles/Spring/Earth_Rock_1.png new file mode 100644 index 0000000..199145b Binary files /dev/null and b/Sprites/Tiles/Spring/Earth_Rock_1.png differ diff --git a/Sprites/Tiles/Spring/Earth_Rock_1_outline.png b/Sprites/Tiles/Spring/Earth_Rock_1_outline.png new file mode 100644 index 0000000..18b7557 Binary files /dev/null and b/Sprites/Tiles/Spring/Earth_Rock_1_outline.png differ diff --git a/Sprites/Tiles/Spring/Earth_Rock_2.png b/Sprites/Tiles/Spring/Earth_Rock_2.png new file mode 100644 index 0000000..32b0998 Binary files /dev/null and b/Sprites/Tiles/Spring/Earth_Rock_2.png differ diff --git a/Sprites/Tiles/Spring/Earth_Rock_2_outline.png b/Sprites/Tiles/Spring/Earth_Rock_2_outline.png new file mode 100644 index 0000000..7280348 Binary files /dev/null and b/Sprites/Tiles/Spring/Earth_Rock_2_outline.png differ diff --git a/Sprites/Tiles/Spring/Earth_Rock_3.png b/Sprites/Tiles/Spring/Earth_Rock_3.png new file mode 100644 index 0000000..b848952 Binary files /dev/null and b/Sprites/Tiles/Spring/Earth_Rock_3.png differ diff --git a/Sprites/Tiles/Spring/Earth_Rock_3_outline.png b/Sprites/Tiles/Spring/Earth_Rock_3_outline.png new file mode 100644 index 0000000..9afd733 Binary files /dev/null and b/Sprites/Tiles/Spring/Earth_Rock_3_outline.png differ diff --git a/Sprites/Tiles/Summer/Earth_Grass_1.png b/Sprites/Tiles/Summer/Earth_Grass_1.png old mode 100755 new mode 100644 index fa059b1..7893161 Binary files a/Sprites/Tiles/Summer/Earth_Grass_1.png and b/Sprites/Tiles/Summer/Earth_Grass_1.png differ diff --git a/Sprites/Tiles/Summer/Earth_Grass_1_outline.png b/Sprites/Tiles/Summer/Earth_Grass_1_outline.png new file mode 100644 index 0000000..6be20f8 Binary files /dev/null and b/Sprites/Tiles/Summer/Earth_Grass_1_outline.png differ diff --git a/Sprites/Tiles/Summer/Earth_Grass_2.png b/Sprites/Tiles/Summer/Earth_Grass_2.png old mode 100755 new mode 100644 index 207319c..305937c Binary files a/Sprites/Tiles/Summer/Earth_Grass_2.png and b/Sprites/Tiles/Summer/Earth_Grass_2.png differ diff --git a/Sprites/Tiles/Summer/Earth_Grass_2_outline.png b/Sprites/Tiles/Summer/Earth_Grass_2_outline.png new file mode 100644 index 0000000..d697686 Binary files /dev/null and b/Sprites/Tiles/Summer/Earth_Grass_2_outline.png differ diff --git a/Sprites/Tiles/Summer/Earth_Grass_3.png b/Sprites/Tiles/Summer/Earth_Grass_3.png old mode 100755 new mode 100644 index 6e896bf..e8beb06 Binary files a/Sprites/Tiles/Summer/Earth_Grass_3.png and b/Sprites/Tiles/Summer/Earth_Grass_3.png differ diff --git a/Sprites/Tiles/Summer/Earth_Grass_3_outline.png b/Sprites/Tiles/Summer/Earth_Grass_3_outline.png new file mode 100644 index 0000000..2b13065 Binary files /dev/null and b/Sprites/Tiles/Summer/Earth_Grass_3_outline.png differ diff --git a/Sprites/Tiles/Summer/Earth_Rock_1.png b/Sprites/Tiles/Summer/Earth_Rock_1.png old mode 100755 new mode 100644 index 10ee636..199145b Binary files a/Sprites/Tiles/Summer/Earth_Rock_1.png and b/Sprites/Tiles/Summer/Earth_Rock_1.png differ diff --git a/Sprites/Tiles/Summer/Earth_Rock_1_outline.png b/Sprites/Tiles/Summer/Earth_Rock_1_outline.png new file mode 100644 index 0000000..18b7557 Binary files /dev/null and b/Sprites/Tiles/Summer/Earth_Rock_1_outline.png differ diff --git a/Sprites/Tiles/Summer/Earth_Rock_2.png b/Sprites/Tiles/Summer/Earth_Rock_2.png old mode 100755 new mode 100644 index 97fcd54..32b0998 Binary files a/Sprites/Tiles/Summer/Earth_Rock_2.png and b/Sprites/Tiles/Summer/Earth_Rock_2.png differ diff --git a/Sprites/Tiles/Summer/Earth_Rock_2_outline.png b/Sprites/Tiles/Summer/Earth_Rock_2_outline.png new file mode 100644 index 0000000..7280348 Binary files /dev/null and b/Sprites/Tiles/Summer/Earth_Rock_2_outline.png differ diff --git a/Sprites/Tiles/Summer/Earth_Rock_3.png b/Sprites/Tiles/Summer/Earth_Rock_3.png old mode 100755 new mode 100644 index 296fdff..b848952 Binary files a/Sprites/Tiles/Summer/Earth_Rock_3.png and b/Sprites/Tiles/Summer/Earth_Rock_3.png differ diff --git a/Sprites/Tiles/Summer/Earth_Rock_3_outline.png b/Sprites/Tiles/Summer/Earth_Rock_3_outline.png new file mode 100644 index 0000000..9afd733 Binary files /dev/null and b/Sprites/Tiles/Summer/Earth_Rock_3_outline.png differ diff --git a/Sprites/Tiles/Ver.1/Autumn/Earth_Grass_1.png b/Sprites/Tiles/Ver.1/Autumn/Earth_Grass_1.png new file mode 100644 index 0000000..f5d6d57 Binary files /dev/null and b/Sprites/Tiles/Ver.1/Autumn/Earth_Grass_1.png differ diff --git a/Sprites/Tiles/Ver.1/Autumn/Earth_Grass_2.png b/Sprites/Tiles/Ver.1/Autumn/Earth_Grass_2.png new file mode 100644 index 0000000..816b711 Binary files /dev/null and b/Sprites/Tiles/Ver.1/Autumn/Earth_Grass_2.png differ diff --git a/Sprites/Tiles/Autumn/Earth_Grass_3.png b/Sprites/Tiles/Ver.1/Autumn/Earth_Grass_3.png similarity index 100% rename from Sprites/Tiles/Autumn/Earth_Grass_3.png rename to Sprites/Tiles/Ver.1/Autumn/Earth_Grass_3.png diff --git a/Sprites/Tiles/Ver.1/Autumn/Earth_Rock_1.png b/Sprites/Tiles/Ver.1/Autumn/Earth_Rock_1.png new file mode 100644 index 0000000..6422d69 Binary files /dev/null and b/Sprites/Tiles/Ver.1/Autumn/Earth_Rock_1.png differ diff --git a/Sprites/Tiles/Autumn/Earth_Rock_2.png b/Sprites/Tiles/Ver.1/Autumn/Earth_Rock_2.png similarity index 100% rename from Sprites/Tiles/Autumn/Earth_Rock_2.png rename to Sprites/Tiles/Ver.1/Autumn/Earth_Rock_2.png diff --git a/Sprites/Tiles/Ver.1/Summer/Earth_Grass_1.png b/Sprites/Tiles/Ver.1/Summer/Earth_Grass_1.png new file mode 100755 index 0000000..fa059b1 Binary files /dev/null and b/Sprites/Tiles/Ver.1/Summer/Earth_Grass_1.png differ diff --git a/Sprites/Tiles/Ver.1/Summer/Earth_Grass_2.png b/Sprites/Tiles/Ver.1/Summer/Earth_Grass_2.png new file mode 100755 index 0000000..207319c Binary files /dev/null and b/Sprites/Tiles/Ver.1/Summer/Earth_Grass_2.png differ diff --git a/Sprites/Tiles/Ver.1/Summer/Earth_Grass_3.png b/Sprites/Tiles/Ver.1/Summer/Earth_Grass_3.png new file mode 100755 index 0000000..6e896bf Binary files /dev/null and b/Sprites/Tiles/Ver.1/Summer/Earth_Grass_3.png differ diff --git a/Sprites/Tiles/Ver.1/Summer/Earth_Rock_1.png b/Sprites/Tiles/Ver.1/Summer/Earth_Rock_1.png new file mode 100755 index 0000000..10ee636 Binary files /dev/null and b/Sprites/Tiles/Ver.1/Summer/Earth_Rock_1.png differ diff --git a/Sprites/Tiles/Ver.1/Summer/Earth_Rock_2.png b/Sprites/Tiles/Ver.1/Summer/Earth_Rock_2.png new file mode 100755 index 0000000..97fcd54 Binary files /dev/null and b/Sprites/Tiles/Ver.1/Summer/Earth_Rock_2.png differ diff --git a/Sprites/Tiles/Ver.1/Summer/Earth_Rock_3.png b/Sprites/Tiles/Ver.1/Summer/Earth_Rock_3.png new file mode 100755 index 0000000..296fdff Binary files /dev/null and b/Sprites/Tiles/Ver.1/Summer/Earth_Rock_3.png differ diff --git a/Sprites/Tiles/Ver.1/Winter/Earth_Grass_1.png b/Sprites/Tiles/Ver.1/Winter/Earth_Grass_1.png new file mode 100644 index 0000000..9f8e5d9 Binary files /dev/null and b/Sprites/Tiles/Ver.1/Winter/Earth_Grass_1.png differ diff --git a/Sprites/Tiles/Ver.1/Winter/Earth_Grass_2.png b/Sprites/Tiles/Ver.1/Winter/Earth_Grass_2.png new file mode 100644 index 0000000..06635cb Binary files /dev/null and b/Sprites/Tiles/Ver.1/Winter/Earth_Grass_2.png differ diff --git a/Sprites/Tiles/Ver.1/Winter/Earth_Rock_1.png b/Sprites/Tiles/Ver.1/Winter/Earth_Rock_1.png new file mode 100644 index 0000000..41c22b3 Binary files /dev/null and b/Sprites/Tiles/Ver.1/Winter/Earth_Rock_1.png differ diff --git a/Sprites/Tiles/Ver.1/Winter/Earth_Rock_2.png b/Sprites/Tiles/Ver.1/Winter/Earth_Rock_2.png new file mode 100644 index 0000000..12b7a01 Binary files /dev/null and b/Sprites/Tiles/Ver.1/Winter/Earth_Rock_2.png differ diff --git a/Sprites/Tiles/Winter/Earth_Grass_1.png b/Sprites/Tiles/Winter/Earth_Grass_1.png index 9f8e5d9..e879b4f 100644 Binary files a/Sprites/Tiles/Winter/Earth_Grass_1.png and b/Sprites/Tiles/Winter/Earth_Grass_1.png differ diff --git a/Sprites/Tiles/Winter/Earth_Grass_1_outline.png b/Sprites/Tiles/Winter/Earth_Grass_1_outline.png new file mode 100644 index 0000000..a7f70e2 Binary files /dev/null and b/Sprites/Tiles/Winter/Earth_Grass_1_outline.png differ diff --git a/Sprites/Tiles/Winter/Earth_Grass_2.png b/Sprites/Tiles/Winter/Earth_Grass_2.png index 06635cb..8826d2e 100644 Binary files a/Sprites/Tiles/Winter/Earth_Grass_2.png and b/Sprites/Tiles/Winter/Earth_Grass_2.png differ diff --git a/Sprites/Tiles/Winter/Earth_Grass_2_outline.png b/Sprites/Tiles/Winter/Earth_Grass_2_outline.png new file mode 100644 index 0000000..95f75ed Binary files /dev/null and b/Sprites/Tiles/Winter/Earth_Grass_2_outline.png differ diff --git a/Sprites/Tiles/Winter/Earth_Rock_1.png b/Sprites/Tiles/Winter/Earth_Rock_1.png index 41c22b3..8d2edcb 100644 Binary files a/Sprites/Tiles/Winter/Earth_Rock_1.png and b/Sprites/Tiles/Winter/Earth_Rock_1.png differ diff --git a/Sprites/Tiles/Winter/Earth_Rock_1_outline.png b/Sprites/Tiles/Winter/Earth_Rock_1_outline.png new file mode 100644 index 0000000..ae395b9 Binary files /dev/null and b/Sprites/Tiles/Winter/Earth_Rock_1_outline.png differ diff --git a/Sprites/Tiles/Winter/Earth_Rock_2.png b/Sprites/Tiles/Winter/Earth_Rock_2.png index 12b7a01..6d37e6f 100644 Binary files a/Sprites/Tiles/Winter/Earth_Rock_2.png and b/Sprites/Tiles/Winter/Earth_Rock_2.png differ diff --git a/Sprites/Tiles/Winter/Earth_Rock_2_outline.png b/Sprites/Tiles/Winter/Earth_Rock_2_outline.png new file mode 100644 index 0000000..4cd4be8 Binary files /dev/null and b/Sprites/Tiles/Winter/Earth_Rock_2_outline.png differ diff --git a/Terrain/Board.java b/Terrain/Board.java index bc9f33c..a87e7f6 100644 --- a/Terrain/Board.java +++ b/Terrain/Board.java @@ -1,39 +1,49 @@ package Terrain; -import Components.Graphics.Drawable; +import Actors.Piece; import Core.*; import java.awt.*; +import java.awt.event.MouseEvent; import java.util.ArrayList; /** * Classe che descrive il tavolo da gioco * Created by dimaer on 27/03/17. */ -public class Board extends GameObject implements Drawable, WeatherObserver { +public class Board extends GameObject implements WeatherObserver { ArrayList cells; + Cell convertedCells [][]; Weather weather; private Point position; + Point mouse; + /** + *Costruttore di Board + * @param position posizione di board sullo schermo + * @param weather instanza di ogetto di Weather + */ public Board(Point position,Weather weather) { super(position); - this.position=position; + mouse = new Point(); + setActive(false); + this.position = position; this.weather = weather; - weather.addWeatherObserver(this); + weather.addWeatherObserver(this);//iscrizione di scachierra sulle notifiche de Weather cells = new ArrayList<>(); + convertedCells = new Cell[8][8]; generateBoard(position); - System.out.println(weather.getWeather().toString()); - } + + } + /**Metodo che aggiorna oservatori di Weather*/ @Override public void setSprite() { for (Cell c : cells){ c.getSprite().setImage(ResourceLoader.getInstance().LoadTile(weather.getWeather().toString(),c.getSpriteType())); } - //cells.clear(); - //generateBoard(position); } /** * Metodo che costruisce il tavolo di gioco @@ -53,7 +63,7 @@ private void generateBoard(Point origin) { cellType = Cell.Type.TYPE1; if(i % 8 == 0) { - offsetY+=43; //E' bruto , bisogna incapsulare + offsetY+=80; //E' bruto , bisogna incapsulare offsetX=0; } @@ -62,10 +72,52 @@ private void generateBoard(Point origin) { cells.add(new Cell(cartToIso(position),spriteType,weather.getWeather().toString())); cells.get(i).getSprite().setDepth(i); cells.get(i).setType(cellType); - offsetX+=43; //E' bruto , bisogna incapsulare + offsetX+=80; //E' bruto , bisogna incapsulare + + } + convertArray(); + } + + /** + * Funzione che converte Array in array bidimensionale + */ + private void convertArray(){ + int count = 0; + for (int x = 0;x<8;x++){ + for(int y = 0;y<8;y++){ + convertedCells[x][y] = cells.get(count); + count++; + } } } + /** + * Metodo che torna la cella di scachiera che e' contenuta nell array bidimensionale + * @param x posizione orizzontale + * @param y posizione verticale + * @return cella di scachiera + */ + public Cell getCell(int x ,int y){ + if(x <=7 || y<=7) + return convertedCells[x][y]; + else + return null; + } + + /** + *Metodo che torna la cella di scachiera in base alla codifica numerica + * @param n numero di cella + * @param ch la lettera di cella + * @return cella di scachiera + */ + public Cell getCell(int n,char ch){ + return convertedCells[n][ch - 97]; + } + + /** + *Metodo che inverte la matrice di celle + * @return l'insieme di celle invertito + */ private ArrayList inverseMatrix() { ArrayList inverseCells = new ArrayList<>(); @@ -81,21 +133,40 @@ private ArrayList inverseMatrix() return inverseCells; } + /** + *Metodo che torna la riga di scachiera + * @param n il numero della riga + * @return l'insieme di celle contenute nella riga + */ + public ArrayList getRow(int n){ + ArrayList row = new ArrayList<>(); + for(int i = 0;i<8;i++){ + row.add(getCell(n,i)); + } + return row; + } + + /** + * + * Metodo che torna la colonna di scachiera + * @param n il numero della colonna + * @return l'insieme di celle contenute nella colonna + */ + public ArrayList getColumn(int n){ + ArrayList column = new ArrayList<>(); + for(int i = 0;i<8;i++){ + column.add(getCell(i,n)); + } + return column; + } /** * Metodo che torna l'insieme di celle - * @return ArrayList l'insieme di celle che compongono la scachiera + * @return l'insieme di celle che compongono la scachiera */ public ArrayList getCells() { return cells; } - /*private ArrayList inverseMatrix() - { - ArrayList inverseCells = new ArrayList<>(); - for(int i = 0;i getCells() { private Point cartToIso(Point vector){ return new Point(vector.x-vector.y,(vector.x+vector.y)/2); } + + /** + *Metodo che aggiorna le celle + * @param mouseEvent evento di Mouse + */ + @Override + public void update(MouseEvent mouseEvent) { + super.update(mouseEvent); + mouse = new Point(mouseEvent.getX(),mouseEvent.getY()); + for (Cell c : cells){ + c.update(mouseEvent); + } + } + + /** + *Metodo che disegna la scachiera + * @param graphics instanza di Graphics + */ @Override public void draw(Graphics graphics) { + for (Cell c : cells){ c.draw(graphics); } diff --git a/Terrain/Cell.java b/Terrain/Cell.java index 63047f4..0d6cefe 100644 --- a/Terrain/Cell.java +++ b/Terrain/Cell.java @@ -1,11 +1,8 @@ package Terrain; -import Components.Event.MouseObserver; -import Components.Graphics.Drawable; import Components.Graphics.Sprite; import Core.GameObject; import Core.ResourceLoader; -import Core.Weather; import java.awt.*; import java.awt.event.MouseEvent; @@ -13,50 +10,121 @@ /** * Created by dimaer on 27/03/17. */ -public class Cell extends GameObject implements Drawable,MouseObserver{ - private Sprite sprite; +public class Cell extends GameObject { + + private Sprite spriteOutline; + private Type type; + private Color colorFill; + private Color attackColor; private String spriteType; + private boolean atackable; + private boolean empty; + /** + *Costruttore di cella + * @param position posizione iniziale sullo scherma + * @param spriteType tipo di sprite + * @param weatherType il tipo di stagione + */ public Cell(Point position, String spriteType, String weatherType){ super(position); - this.spriteType=spriteType; - sprite = new Sprite(position); - System.out.print(getClass().toString() + ":[spriteType: " + spriteType + "]\n"); - sprite.setImage(ResourceLoader.getInstance().LoadTile(weatherType,spriteType)); + empty = true; + atackable=false; + setActive(false); + colorFill = new Color(0,0,0,100); + attackColor = new Color(200,0,0,200); + this.spriteType = spriteType; + spriteOutline = new Sprite(position); + + getSprite().setImage(ResourceLoader.getInstance().LoadTile(weatherType,spriteType)); } //Enumerazione che contiene dei valori di tipo di cella (il colore sulla scacchiera) + enum Type{ TYPE1,TYPE2 } + public void setEmpty(boolean empty) { + this.empty = empty; + } + + public boolean isEmpty() { + return empty; + } + /** - * - * @param type + *Metodo che torna le coordinate della cella in base di scachiera + * @return + */ + public Point getCoord(){ + + int depth = getSprite().getDepth(); + + int n = depth / 8; + + return new Point(n,depth - (8*n)); + } + /** + *Metodo che imposta il tipo di cella + * @param type tipo di cella */ public void setType(Type type) { this.type = type; } + + /** + *Metodo che torna il topo di sprite + * @return il tipo di sprite + */ public String getSpriteType(){return spriteType;} + /** - * - * @return + *Metodo che imposta se la cella e' attacabile + * @param atackable flag */ - public Sprite getSprite() { - return sprite; + public void setAtackable(boolean atackable) { + this.atackable = atackable; } - /*@Override - public Point getPosition() { + /** + *Metodo che verifica se la cella e' attacabile + * @return flag + */ + public boolean isAtackable() { + return atackable; } - */ - @Override - public void update(MouseEvent mouseEvent, String message) { + /** + *Aggiorna la cella + * @param mouseEvent evento di Mouse + */ + @Override + public void update(MouseEvent mouseEvent) { + super.update(mouseEvent); } + /** + *Metodo che disegna la cella + * @param graphics instanza di Graphics + */ @Override public void draw(Graphics graphics) { - sprite.draw(graphics); + + if(isVisibility()){ + super.draw(graphics); + spriteOutline.draw(graphics); + } + if(isActive()) { + + graphics.setColor(colorFill); + + if(isAtackable() ) + graphics.setColor(attackColor); + + graphics.fillOval(getSprite().getCenter().x - 20, getSprite().getCenter().y, 40, 25); + graphics.setColor(new Color(0,0,0)); + } + } } diff --git a/Utils/Log.java b/Utils/Log.java deleted file mode 100644 index 1883e0f..0000000 --- a/Utils/Log.java +++ /dev/null @@ -1,47 +0,0 @@ -package Utils; - -import Components.Graphics.Drawable; -import Components.Graphics.Sprite; -import Terrain.Cell; - -import java.awt.*; -import java.util.ArrayList; - -/** - * Created by dimaer on 29/03/17. - */ -public class Log { - private Log() - { - - } - - private static Log log = new Log(); - - public void showDepth(Graphics graphics, Sprite sprite) - { - int depth = sprite.getDepth(); - graphics.drawString(new String("" + depth),sprite.getPosition().x,sprite.getPosition().y); - } - public void showDepth(Graphics graphics, ArrayList cells) - { - for (Cell cell : cells){ - int depth = cell.getSprite().getDepth(); - graphics.drawString(new String("" + depth), - cell.getSprite().getCenter().x , //35 - cell.getSprite().getCenter().y ); //20 - } - - } - public void showOrigins(Graphics graphics,Sprite sprite) - { - //for(Drawable d : objects){ - graphics.fillOval(sprite.getCenter().x,sprite.getCenter().y,10,10); - //graphics.drawOval(); - //} - } - public static Log getInstance() - { - return log; - } -}