import java.awt.*;
import java.util.ArrayList;


public class Territory {
    private ArrayList<Patch> patch = new ArrayList<Patch>();
    private String name;
    private Point capital;
    private ArrayList<Territory> neighbour = new ArrayList<Territory>();

    private ArrayList<Polygon> p = new ArrayList<Polygon>();
    private boolean newPatchData = false;


    private int army = 0; // counter for armys on this Territory the information
    // which Army it is is in the Class Gamer

    public Territory() {
    }

    public Territory(String name, Point capital) {
        this.name = name;
        this.capital = capital;
    }


    /**
     * this will be used on the first stage of the game where the capture of the territory is the business
     */
    public void captureTerritory() {
        army = 1;
    }

    public void addArmy(int count) {
        army += count;
    }

    public void removeArmy(int count) {
        if (army - count >= 0)
            army -= count;
    }

    public int getArmyCount() {
        return this.army;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setCapital(Point capital) {
        this.capital = capital;
    }

    public void addPatch(Patch data) {
        this.patch.add(data);
        newPatchData = true;

    }

    public void addNeighbour(Territory data) {
        this.neighbour.add(data);
    }

    public ArrayList<Territory> getNeighbours() {
        return this.neighbour;
    }

    public boolean checkNeighbour(Territory data) {
        return this.neighbour.contains(data);
    }


    public void createPolygon() {
        p.clear();
        for (int i = 0; i < this.patch.size(); i++) {
            p.add(patch.get(i).get_Polygon());

        }
    }

    public void printTerritory(Graphics g, String argument) {
        /* check if there are new Data for this Territory
         * if this is true we need to rebuild the Polygon ArrayList
		 */
        if (newPatchData) {
            createPolygon();
            newPatchData = false;
        }
        if (argument == "fill") {
            for (int i = 0; i < this.p.size(); i++) {
                g.fillPolygon(p.get(i));
            }
        } else if (argument == "outline") {
            for (int i = 0; i < this.p.size(); i++) {
                g.drawPolygon(p.get(i));
            }
        }
    }


    public boolean check_isInsideTerritory(int x, int y) {

        for (int i = 0; i < this.p.size(); i++) {
            if (p.get(i).contains(x, y))
                return true;
        }

        return false;
    }


    public String toString() {
        String ret = name + "   " + capital.toString() + "\n";
        ret += "neighbours: ";
        for (int i = 0; i < neighbour.size(); i++) {
            ret += neighbour.get(i).name;
        }
        ret += "\n \n patch: ";
        for (int i = 0; i < patch.size(); i++) {
            ret += patch.get(i);
        }
        ret += "\n";
        return ret;
    }
}

@@ -631,24 +631,169 @@
 tal;%0A    %7D%0A%0A
+    public Point getCapital() %7B%0A        return capital;%0A    %7D%0A%0A    public void setCapital(Point capital) %7B%0A        this.capital = capital;%0A    %7D%0A
 %0A    /**%0A   
@@ -1279,91 +1279,8 @@
  %7D%0A%0A
-    public void setCapital(Point capital) %7B%0A        this.capital = capital;%0A    %7D%0A%0A
     
@@ -2160,24 +2160,66 @@
 = %22fill%22) %7B%0A
+            g.setColor(Color.lightGray);%0A%0A
             
@@ -2252,32 +2252,71 @@
 .size(); i++) %7B%0A
+                System.out.println(i);%0A
                 
@@ -2332,32 +2332,34 @@
 ygon(p.get(i));%0A
+%0A%0A
             %7D%0A  
@@ -2348,32 +2348,33 @@
 %0A%0A            %7D%0A
+%0A
         %7D else i
@@ -2397,24 +2397,61 @@
 outline%22) %7B%0A
+            g.setColor(Color.black);%0A
             
@@ -2484,32 +2484,33 @@
 .size(); i++) %7B%0A
+%0A
                 
@@ -2557,32 +2557,348 @@
        %7D%0A    %7D%0A%0A
+    public void printTerritoryCapital(Graphics g) %7B%0A        g.setColor(Color.black);%0A%0A        // Determines the size of the capital cities(oval).%0A        final int capitalCityDimension = 8;%0A%0A        g.fillOval((int) this.capital.getX(), (int) this.capital.getY(), capitalCityDimension, capitalCityDimension);%0A    %7D%0A%0A
 %0A    public bool
@@ -3474,24 +3474,24 @@
 et += %22%5Cn%22;%0A
-
         retu
@@ -3503,11 +3503,122 @@
 t;%0A    %7D
+%0A%0A    public void printMyPolygon(Graphics g, String fill, int i) %7B%0A%0A        g.drawPolygon(this.p.get(i));%0A    %7D
 %0A%7D%0A

Update Territory.java