From c7bf2268e8279d635821acd51b3de496e60cb56a Mon Sep 17 00:00:00 2001 From: Tony Grosinger Date: Thu, 19 May 2011 17:22:54 -0700 Subject: [PATCH] -Created TownHall object -Implemented Inventory -Started Objectives Signed-off-by: Tony Grosinger --- .../nomads/DroneListItem$Direction.class | Bin 1272 -> 1272 bytes .../nomads/DroneListItem$EnumMove.class | Bin 1480 -> 1480 bytes bin/net/grosinger/nomads/DroneListItem.class | Bin 6350 -> 6619 bytes bin/net/grosinger/nomads/DroneTools.class | Bin 5632 -> 5683 bytes bin/net/grosinger/nomads/InitializeGame.class | Bin 5495 -> 5512 bytes bin/net/grosinger/nomads/Nomads.class | Bin 4015 -> 4309 bytes bin/net/grosinger/nomads/Objective.class | Bin 556 -> 885 bytes bin/net/grosinger/nomads/TownHall.class | Bin 0 -> 1657 bytes bin/net/grosinger/nomads/World.class | Bin 7508 -> 7556 bytes src/net/grosinger/nomads/DroneListItem.java | 53 ++++++++++++------ src/net/grosinger/nomads/DroneTools.java | 9 +-- src/net/grosinger/nomads/InitializeGame.java | 6 +- src/net/grosinger/nomads/Nomads.java | 32 ++++++++++- src/net/grosinger/nomads/Objective.java | 36 +++++++++++- src/net/grosinger/nomads/TownHall.java | 23 ++++++++ src/net/grosinger/nomads/World.java | 16 ++++-- 16 files changed, 138 insertions(+), 37 deletions(-) create mode 100644 bin/net/grosinger/nomads/TownHall.class create mode 100644 src/net/grosinger/nomads/TownHall.java diff --git a/bin/net/grosinger/nomads/DroneListItem$Direction.class b/bin/net/grosinger/nomads/DroneListItem$Direction.class index eb5ce2e69adfe22fc4552cdb53252d33da7d128d..810fd9ee3eb8ef7ac9a3f4889d73d0071126badd 100644 GIT binary patch delta 23 ecmeyt`Ga!<9}BA-g9(G|WMLK)M%l?8EE@n!-UY+} delta 23 ecmeyt`Ga!<9}BBIg9(G&WMLK)M!CrzEE@n!{RPJW diff --git a/bin/net/grosinger/nomads/DroneListItem$EnumMove.class b/bin/net/grosinger/nomads/DroneListItem$EnumM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gLq9{LC|riNL^c`JV{o&Wx=bSD0f`lQf!9=IJY?tzb=sh+Pq%bK zC>X@BiUg9>9F(xYjWQJByxnBZb~k!|2z2*B07#q=HNB#n2aC zOI1Z;S+A9Co7y-?&Cnkna(%-T6Fm-Yto{F~Iz76YtaKQy+q5z9*><`1VS^uC4ym$j zm2FL|Qs2gb(|p@pozz!R;wODpfZ4ef;ES@+2Dknf{|{++Z}gDyYA53-`P zPM>39BvL{A0t5N6Zx}p7*VqLHD;S!VM%$zch{8k#)90w86_;-u2ltzwPP;)JtK raT2mVzE_dw|BC!y2N@&3F)U-?7x~nXW?pq0$kSgTpBQ0m&UgF+%ucnQ literal 0 HcmV?d00001 diff --git a/bin/net/grosinger/nomads/World.class b/bin/net/grosinger/nomads/World.class index 82177ecc91759ae3a9ee7e67275cc63dc24426ef..ce036e1214b534d3a3bf188a840f6aad2274dcd9 100644 GIT binary patch delta 1539 zcmX|BZERCz6n>uDcDL_ii4G}4MD(tfdl3gG-X_u!q{r*z$GL_ z1os0$%uO^wK~TsdF_AIdCNmfkL@^Sh!57)d@lh@l?~bSdZF|m$YbCy^mKNCg7{MyD`ITn#tBgxI;jAXMsBAXq z4p>^*W(3`>;WaX}orzddFV+)@zC@(h$#$+&xt8#3iSCG2$NH*QwJm?4OOGdGeZ3mj zj~sPxq<1l#SOO0k;m1-0u?!(BH{5x9B(IUzzzxQgyjJSQOi!aN2?zR(m?z~*As4$* zf)`PaJ;p81uH5~S=N07P0DL%vS$NIZlfTY&7&g2qo+DD>=*ZRl)m(ELDuyu)BdEeh zn2%Ac#28vIj`jE$TW}UVn2=PT;Go34fzvpK3wRHo;Zt0c?{i$n7nsB){4TaT_{!Kf z{Vsnrb{BLxeuf=a;leM*^@4K82`R1tJZS`dH+-*K>g+>!IrJe)y!NnH4M!Y)$3-NJ zGJk~gj4pp^D%bBgkCDR=$9XCpd+qev-J6f!AK0tXtD0IYuL9({0GWgrzsW@YL^W=p4mVMcztDhNXu@r2_-}NIuM2k($3H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C=-NxbYl(cmXAN(Kwyi?tBFnyegh!lHvHY&AW+h=U~O#NW%pz!$s8M9jwC)S}}{Q zxP*SZive7gFjp`s=U&1&yp9iX2G{T&KEieR+`z}Ug-`H{*zV#p<4o2(zco%}ciX>* z4L`t%9}SnU%>J?@*8v_kntZo?lcpNm6!rx!qR?v#d99&(yWf5t{YHzwo6UmO?1 z`N)YxfrD0ht!gzA@LR4>>-5k(%aq(1T4$I#%e3<%WwTTZoR&@iH-*4Y zLf~h3g`y9?B8cBmgWIUX9qIA!*nmHz&^dI9uUqI3V_v%W7bfs`TpD)|$4HzK$)BYO zvozzHtUqT8zM~blXvZBoaF?m_Khf!68r@81uE@TW84Svi|x$j4*EDEr=Au$ z9bz7jaUqrn&69AczMwQgT2^!;1#!_fkJ5uTp~1_;%%m44_~dGqxXn^aK!Wrg;{qVD~YAcwi)osjekm?w9pB*kljR;l)Aay5rTGSU>uWsy;zKo#tAD}a-w z641d?8;;b;u5-JH&%>SR%LZd5pZ``8IiySpv6Ai9Di)#L*-F1^4- zGhEyuSenG8NnDo1sw7q?@xdh4D^$}pC8k>Qw3~zr=?{ULLNVVRMCi zmB{dQy?JSc-+YPdI;M~xz5vgCC5Gjw9NKjM+zfKhC$d$gC)jD-(*5$_{Q5OBHh1$;ZX^mYkG# ReAvpi9C?4Y%U09)#J^W9E(ZVr diff --git a/src/net/grosinger/nomads/DroneListItem.java b/src/net/grosinger/nomads/DroneListItem.java index a23b2ee..bb09600 100644 --- a/src/net/grosinger/nomads/DroneListItem.java +++ b/src/net/grosinger/nomads/DroneListItem.java @@ -1,16 +1,15 @@ package net.grosinger.nomads; -/* - * A class that allows a drone to be part of a linked list - * Provides reference to the next drone, the previous drone, and the drone object +import java.util.ArrayList; + +/** + * A class that allows a drone to be part of a linked list Provides reference to + * the next drone, the previous drone, and the drone object * - * +----------------------------------------------------------+ - * | Most of the inner workings of the program that we do not | - * | want a drone to have access to will take place here | - * +----------------------------------------------------------+ + * Most of the inner workings of the program that we do not want a drone to have + * access to will take place here * - * Previous --> Towards the first item - * Next --> Towards the last item + * Previous --> Towards the first item Next --> Towards the last item */ public class DroneListItem { private DroneListItem next; @@ -31,7 +30,7 @@ public class DroneListItem { N, S, E, W } - // Stats about this robot + // Statistics about this robot private int visibleDistance; private int lumaLocatorDistance; @@ -47,6 +46,8 @@ public class DroneListItem { private int age; private int x; private int y; + private int waiting; // Is the drone building another drone or house? + private ArrayList inventory; /* * Default constructor, includes all references @@ -58,6 +59,8 @@ public class DroneListItem { visibleDistance = 15; speed = 1; team = theTeam; + waiting = 0; + inventory = new ArrayList(); // Place itself in the world Nomads.awesomeWorld.placeNewDrone(this); @@ -256,6 +259,16 @@ public class DroneListItem { y = newY; } + /** + * Adds the existing waiting time (which should be 0) to the provided time + * + * @param newWaiting + * - Amount of time to add to waiting timer + */ + public void setWaiting(int newWaiting) { + waiting += newWaiting; + } + /** * Increases the Visible Distance by specified amount * @@ -338,7 +351,12 @@ public class DroneListItem { // Movement - public void moveDrone(Direction direction) { + private void moveDrone(Direction direction) { + if (waiting != 0) { + waiting--; + return; + } + int amountN = 0; int amountE = 0; switch (direction) { @@ -361,12 +379,13 @@ public class DroneListItem { } // Check to see if there is a MoneyPile or Objective there GameObject objectHere = Nomads.awesomeWorld.getObjectAt(getX() + amountE, getY() + amountN); - if (objectHere instanceof MoneyPile) { - int value = ((MoneyPile) objectHere).getValue(); - team.increaseBalance(value); - Nomads.awesomeWorld.generateMoneyPile(); - } else if (objectHere instanceof Objective) { - // TODO - Implement moving onto Objective + + if (inventory.size() < cargoSpace) { + if (objectHere instanceof MoneyPile || objectHere instanceof Objective) { + inventory.add(objectHere); + } + } else { + // TODO - Inventory is full, do not allow move } // Make the move diff --git a/src/net/grosinger/nomads/DroneTools.java b/src/net/grosinger/nomads/DroneTools.java index 6d3ecb2..dc23b7e 100644 --- a/src/net/grosinger/nomads/DroneTools.java +++ b/src/net/grosinger/nomads/DroneTools.java @@ -165,13 +165,10 @@ public class DroneTools { House newHouse = new House(Structure.HOUSE, intendedPoint.getX(), intendedPoint.getY(), referredDrone.getName()); worldReference.placeNewBuilding(newHouse); currentTeam.deductFromBalance(Nomads.HOUSEPRICE); + listItem.setWaiting(Nomads.CREATIONTIME); return newHouse; } else return null; - - // TODO - Implement time to create house - // Building a house should take many turns. Their drone will remain - // immobile while house is constructed. } /** @@ -182,9 +179,7 @@ public class DroneTools { Point location = new Point(getX(), getY()); currentTeam.createNewDrone(listItem, location); currentTeam.deductFromBalance(Nomads.DRONEPRICE); - // TODO - Implement time to create new drone - // Creating a drone should take many turns. Their drone will remain - // immobile while drone is constructed. + listItem.setWaiting(Nomads.CREATIONTIME); } } diff --git a/src/net/grosinger/nomads/InitializeGame.java b/src/net/grosinger/nomads/InitializeGame.java index 2ae8980..7f59baf 100644 --- a/src/net/grosinger/nomads/InitializeGame.java +++ b/src/net/grosinger/nomads/InitializeGame.java @@ -62,14 +62,12 @@ public class InitializeGame { while (entries.hasMoreElements()) { JarEntry element = entries.nextElement(); - if (element.getName().endsWith(".class")) { + if (element.getName().endsWith(className + ".class")) { try { @SuppressWarnings("rawtypes") Class c = clazzLoader.loadClass(element.getName().replaceAll(".class", "").replaceAll("/", ".")); // Create new GameObject - // TODO - This will break if it loads a class from a jar - // that does not extend Drone GameObject newGameObject = (GameObject) c.newInstance(); newGameObject.setName(className); Drone newDrone = (Drone) newGameObject; @@ -168,7 +166,7 @@ public class InitializeGame { * Generate the money piles and place them on the map */ public static void initializeMoneyPiles() { - for(int i = 0; i < Nomads.MONEYPILES; i++){ + for (int i = 0; i < Nomads.MONEYPILES; i++) { MoneyPile newPile = new MoneyPile(); Nomads.awesomeWorld.setObjectRandom(newPile); } diff --git a/src/net/grosinger/nomads/Nomads.java b/src/net/grosinger/nomads/Nomads.java index 32ff7d9..d51a453 100644 --- a/src/net/grosinger/nomads/Nomads.java +++ b/src/net/grosinger/nomads/Nomads.java @@ -129,6 +129,12 @@ public class Nomads { return getWinner(); } + /** + * Output the winning messages + * + * @param winner + * - The team that won + */ public static void finishGame(DroneTeam winner) { if (winner == null) System.out.println("There was no winner, please play again"); @@ -136,9 +142,31 @@ public class Nomads { System.out.println("The winner was " + winner.getName()); } + /** + * Find the last team alive, or the one with the most money + * + * @return DroneTeam + */ public static DroneTeam getWinner() { - // TODO - Implement getWinner - return null; + // When the last drone in the team is killed it will be removed from the + // list + + // If there is only 1 drone left, it is the winner + if (allTeams.size() == 1) + return allTeams.get(0); + else if (allTeams.isEmpty()) { + // No winner, this probably won't happen + return null; + } else { + // There were multiple teams left, check their balances + DroneTeam winner = null; + int highestBalance = 0; + for (DroneTeam team : allTeams) { + if (team.getBalance() > highestBalance) + winner = team; + } + return winner; + } } public static DroneListItem droneToListItem(Drone theDrone) { diff --git a/src/net/grosinger/nomads/Objective.java b/src/net/grosinger/nomads/Objective.java index f53592b..790afa4 100644 --- a/src/net/grosinger/nomads/Objective.java +++ b/src/net/grosinger/nomads/Objective.java @@ -1,15 +1,45 @@ package net.grosinger.nomads; +/** + * A goal for a drone to collect. Holds a monetary reward if returned to a + * TownCenter by the Drone that issued it. + */ public class Objective implements GameObject { - // TODO - Implement Objective + private int bounty; + private String UID; + private String name; + + public Objective(int newBounty, String newUID) { + bounty = newBounty; + UID = newUID; + } + @Override public String getName() { - return null; + return name; + } + + /** + * Return the bounty associated with this objective + * + * @return int + */ + public int getBounty() { + return bounty; + } + + /** + * Return the UID of the Drone that can pick this Objective up + * + * @return String + */ + public String getUID() { + return UID; } @Override public void setName(String newName) { - + name = newName; } } diff --git a/src/net/grosinger/nomads/TownHall.java b/src/net/grosinger/nomads/TownHall.java new file mode 100644 index 0000000..23647d3 --- /dev/null +++ b/src/net/grosinger/nomads/TownHall.java @@ -0,0 +1,23 @@ +package net.grosinger.nomads; + +import java.util.ArrayList; + +public class TownHall extends Building { + + public TownHall(int newX, int newY) { + super(Structure.TOWNHALL, newX, newY); + } + + public void cashInventory(ArrayList inventory, DroneTeam team) { + while (!inventory.isEmpty()) { + GameObject currentObject = inventory.get(0); + if (currentObject instanceof MoneyPile) { + int value = ((MoneyPile) currentObject).getValue(); + team.increaseBalance(value); + Nomads.awesomeWorld.generateMoneyPile(); + } else if (currentObject instanceof Objective) { + // TODO - Implement turning in objective + } + } + } +} diff --git a/src/net/grosinger/nomads/World.java b/src/net/grosinger/nomads/World.java index bc940ef..2ad9020 100644 --- a/src/net/grosinger/nomads/World.java +++ b/src/net/grosinger/nomads/World.java @@ -46,7 +46,8 @@ public class World { } /** - * Moves the object at x, y by the specified amount + * Moves the object at x, y by the specified amount. If there is already an + * object there it will overwrite that object. * * @param startingX * X index of starting location @@ -218,11 +219,11 @@ public class World { // TODO - Implement buildingsInRange return null; } - + /** * Generates a new MoneyPile at random location */ - public void generateMoneyPile(){ + public void generateMoneyPile() { MoneyPile newPile = new MoneyPile(); setObjectRandom(newPile); } @@ -274,11 +275,18 @@ public class World { g2d.fillOval(j * 10, i * 10, 10, 10); } else if (objectHere instanceof Building) { // TODO - Add color-coding to buildings on map - // World owned buildings should be black + // World owned buildings should be black - use colorMap to + // get color for each team g2d.setColor(Color.black); g2d.fillRect(j * 10, i * 10, 10, 10); } else if (objectHere instanceof MoneyPile) { // TODO - Implement mapping of MoneyPiles + // Should be black since they are world owned but a + // different shape than anything else + } else if (objectHere instanceof Objective) { + // TODO - Implement mapping of Objective + // Should be black since they are world owned but a + // different shape than anything else } } }