From 70a933ac0928f1d988cca9bf6a66558e8cbba493 Mon Sep 17 00:00:00 2001 From: Tony Grosinger Date: Fri, 22 Apr 2011 19:46:44 -0700 Subject: [PATCH] -Major overhaul of design. Now using interfaces rather than extending -Added DroneTools to allow a Drone to find out necessary information -Prevented drone from accessing information it shouldn't get -Changed moving again -More stuff that I have forgotten by now --- .../grosinger/nomads/Building$Structure.class | Bin 1270 -> 1270 bytes bin/net/grosinger/nomads/Building.class | Bin 553 -> 837 bytes bin/net/grosinger/nomads/Drone.class | Bin 2344 -> 410 bytes .../nomads/DroneListItem$Direction.class | Bin 0 -> 1272 bytes .../nomads/DroneListItem$EnumMove.class | Bin 0 -> 1480 bytes bin/net/grosinger/nomads/DroneListItem.class | Bin 4347 -> 5259 bytes bin/net/grosinger/nomads/DroneTeam.class | Bin 2627 -> 2727 bytes bin/net/grosinger/nomads/DroneTools.class | Bin 0 -> 1492 bytes bin/net/grosinger/nomads/GameObject.class | Bin 840 -> 205 bytes bin/net/grosinger/nomads/InitializeGame.class | Bin 4070 -> 4072 bytes bin/net/grosinger/nomads/World.class | Bin 1804 -> 1804 bytes sql_info.txt | 4 + src/net/grosinger/nomads/Building.java | 15 +- src/net/grosinger/nomads/Drone.java | 123 +----------- src/net/grosinger/nomads/DroneListItem.java | 186 ++++++++++-------- src/net/grosinger/nomads/DroneTeam.java | 23 ++- src/net/grosinger/nomads/DroneTools.java | 61 ++++++ src/net/grosinger/nomads/GameObject.java | 29 +-- src/net/grosinger/nomads/World.java | 2 - 19 files changed, 208 insertions(+), 235 deletions(-) create mode 100644 bin/net/grosinger/nomads/DroneListItem$Direction.class create mode 100644 bin/net/grosinger/nomads/DroneListItem$EnumMove.class create mode 100644 bin/net/grosinger/nomads/DroneTools.class create mode 100644 sql_info.txt create mode 100644 src/net/grosinger/nomads/DroneTools.java diff --git a/bin/net/grosinger/nomads/Building$Structure.class b/bin/net/grosinger/nomads/Building$Structure.class index e5a0bffd53b2db9391e665ec57168ee0d37bc9c4..414e1ca0ce706d719fbede15f79604d1916e30e4 100644 GIT binary patch delta 23 ecmeyy`Hgb}4+|?Vg9!uAWI+}aMxM!TEE@nyI|YXT delta 23 ecmeyy`Hgb}4+|>~g9!uoWI+}aM()XOEE@ny90h~` diff --git a/bin/net/grosinger/nomads/Building.class b/bin/net/grosinger/nomads/Building.class index a63791b4746409f06e5caa71ab55d620218b4da0..6d2e574d943175db392c78376534cfe294717d4d 100644 GIT binary patch literal 837 zcma)4U279T6g`uVU9;V^X>GMl6WeM_lPE6us+3|NB82!5$@?T3(k+`=*bn_%3X0%^ zKfoVVdM3#xg_e?C=Cb$Bx#yfav;S}Y{sZt1XEt&Ib*&O_5{0p^Co1xEIF;kr`^=z3bWZyj^u0hq zlSE*ryVB)0-EhzP;A=m*5O~vAo3S|{XFD7#2YGC{*g!=f-)Ig>po$9{PXxBQzE-_- zI#khDISgj{;YbDp8Tlq(6bs3fA9MJ}#c9+vz-&ALd!mxwY^>cz^ZsDQ$)Sr9975v^ zy4SdmG{e|heV>y#{V@s^cM`Mp) z=5g?x?1Jw;4i=o=EC-6MU#R{dXijIbYzPdEktbk5BTz$q(R@L)F=QDt)s-1%Ry|}- e?T!&^X~e<{nh``Du{(!j9)hta@RIBF^57Pf+_swl delta 196 zcmXAhJqp4=5QX1t*2Kh^tUrk+5G;*9l_yXTk6G>ci_)W2Q(7#J9g7=+mwm>3zPCI_;JPQK5?D#Ome!pIICY1GXxWi^eHIHjRipeF*Q;|=r)XiY^_x5zyjkOy~rG}k6o zsK<+@CFfg>HR&uGYjx(6DcTjIzGOJ2`VNf=Z^Lv228xkI@q?S>bv5bD*;^#ZkBbQh)QW(vqw5kH*QN?%#8{W88@@zW z)2!WX9n-iY&>0>-koBf?1lmRmg|XE`Sc%#stRr-rHC#${|7%&gUOVoipy7c)e`Hqk z{$%O+03VXo*p{x{kju7HXD41GDF2kbo5Mp5^RJs#-%H0MERdJd^S?_R4nN6)O0uM5 zQ5`3EyrK+CI+phhk5gC?=$kPt%l1@%<)ti>&D!f(ha<`fp2H_PKE-EDm;}MxPc!`s zsz%XmID8-|oTseGzv$hjQIT1@QfW0!Sxv#9is;~9PLUZ6yJdMyINZ%La@S9&v*a0- zXLCj~9LOZ&nXXY$0vkHokfcCd-$cl0L5+6OlG}7)ZA`1;$cD5OLLkkKIu&`(RMVdJ z$7(`pmyQL?lFm%sa9znq@^gW6ksb9h`#NO?`(uo=3@6SvRv@Ng;;w^xK7ssg=hrRT z1=r5p9@0C|GnrkS_>qPfPV@Je5AH$&8R+OiKW%ydzyQwhs~dwD3dt7er^tp$^eeI} znR9zMpZf_TyU1lG__K?*NYCY+ALtfbk>(0g4f5}hemJBTYFI=139gDhv4d-e_@r+e zIf6|bg!VqBLhNNGqOe*n5#PhD7YEk|@GD2)+5vnf0v?NkPesD-M!@5Vh}#R1@YyJM zECRk50nezXB+UI!wk5%Y%R9KYi{cdP|51PW%=Z`ycHg0wn~w*SNe_0<(W%7nnB9uM zAS|#3?z>q1Jve?69_yJhcL`P0xG$R#Ut3S9vogl9hO4OH8mcH_ozq{#5;pM!&-}P^ zL2O~s872LLrj&_FQXLvrh)t4P@`e=RfAN1u`yi#aj)gGCJXh7 zyC#DOhG2@9C=n)e{Xe62sQy5jUvY50_8EEuuY*vNOhJX(jrzer-C&q1kdE96BT1Aa f2){uZ-yR96BP5KWL0}9PY_95UypATE+kO840z2SX diff --git a/bin/net/grosinger/nomads/DroneListItem$Direction.class b/bin/net/grosinger/nomads/DroneListItem$Direction.class new file mode 100644 index 0000000000000000000000000000000000000000..810fd9ee3eb8ef7ac9a3f4889d73d0071126badd GIT binary patch literal 1272 zcmb7ET~pIQ6g^AYrVSBFMUZbr)V362Rq&%7rU-SWV}XZ2osLgwS!HuW!Gu8LsNYT7Nw3c4P3y%gdU1jWG$-k=Za702P8 ztdRREo--`|-`Z5g)gdY6$ruV9v1n;Z*a@JKoFqpwksQfCKyq5Rhaw|nE*&>0Z-me% z!s6Qh23AjvDrZQZVqAiWhy;@oOhqM_mS8p}!JPV?l9V3C&3dGVNwXg9VcM+6dYCg$ zvG9d>hj5pk8jZj_o?;G*a#g&cqtdS;Pa1>@HM=}}hI`kEF$zFGNtbgKOF|AEiu-ub zPhThLB7LHVh58#Mdr>cn%662Qb3Dv_rZ<;mT(VJ<<%-}~!D^o)OEKbGT8d@QVf+C5 acb-CjG{O0V1c`AC>mrl#8J^)qY3esivLv_w literal 0 HcmV?d00001 diff --git a/bin/net/grosinger/nomads/DroneListItem$EnumMove.class b/bin/net/grosinger/nomads/DroneListItem$EnumMove.class new file mode 100644 index 0000000000000000000000000000000000000000..25ad3e630a78077acdcda0d3cf0a8ab01cfb5ece GIT binary patch literal 1480 zcmb7^TT|0e5Xb+=UXqpowF+_*MXS(qDX8G3m5WfcTFOHNC*xBnu>?!PBq=j|Am6n- z!05>MsvpX6_fVidI8Hm$?)jbU?%Cb^Pk;UXdJ5nHUMsjFFz#4Ew(7aQ?Nlu<>$rR7 zwx3<`T*oTeeozdoy;Q-e@2$B9mV&TA*RFYBW^1NX&GNoLwCwUjfyq)ExpD%Lvg-vq zWOcXBHe4|MfXq9Kjk2*{^~`O`8(j(lv+|K01Iw%lbQH=PYpKnp(ndiSn0nvlxoW;r zvmHB_7YL1|H|fM>ciU1Ci9?`ALoaU7q4}mu?^x-wV?FR_PPt-wGe*As8X}0QP#A_Z zC=4pYEe$F|jNy)k7(<-lo`yI>2g8_#4hD^3T!Y5Y$uOm%6H#7GYv@9^KzGS@ta5#C z%ktiuTQ!kK{tzD}U{{QB^Aa=eO|>{wdF|v68;oBQ>(gNbS~Eolo#46w2&Q<%h>z*WkdB>G9rpHJT)jO4Y@F|Hq>Pr^W0!k~nk5edT*Zbv1I zNVuy=NJ+S_N*I-pPMrB=BuymF948a%cRDN7K%Z`e8yM7$NCU&V5p7^ZHB(6cXW7I>2{BUVd^1Oe keE6(*Qe;lB@B`xCaUr~rIhU~_Z2_wsN$~n+a literal 0 HcmV?d00001 diff --git a/bin/net/grosinger/nomads/DroneListItem.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2yycbdmTe~uh*ZYHN44IDO2Wx@oGR($! z)TMP!RMIFjj75fO=oTf->`lvCqMQuTIhEB3j@$q@H>wI{uCG`f{Xx4mU%6ow8N;ANhh?C%9cX z!IJT=O4GgSPYf7GNd-)vNys__90?P;uYFjNNDpGkb{u&rp1d4K)?B)H^qrUE$q)Ze Qw)>E4@#IHTm;@gG0ZEu0N&o-= literal 0 HcmV?d00001 diff --git a/bin/net/grosinger/nomads/GameObject.class b/bin/net/grosinger/nomads/GameObject.class index 922a918ab3ca1310a946efb4df90c7c787666055..b6dca7977ce5a1127e7b1841a3549129de098213 100644 GIT binary patch delta 97 zcmX@Xc9xOr)W2Q(7#J9g7`P{L*~+u0rgOcprRxWm6lLb6 vTTj+vRGOT?D6huG$iT?J4AjTKz{JAHz{~YW*$7iG z1*UGDd&h1&UdxWU0^*UU!t*3xdV~wiRC}F=9!Hu;~l`E@;RT zS51@Yt#V(j2YGT5{D1@uWsI4j{4knIh%re7cf;FaWitxKk^^^tPa;&=+|1L*3utZYq8ckHU@m{y&>PPwMwnEKeV>^IqEC6^%{460Qie@ AvH$=8 diff --git a/bin/net/grosinger/nomads/InitializeGame.class b/bin/net/grosinger/nomads/InitializeGame.class index 1d1865c87526bee39cd8c76604cdec4eb22ef164..63b3a898619587cc051f14b20203a307dca0e393 100644 GIT binary patch delta 302 zcmW-cJ4ixd0ENF_Q@eV-Loe<%L39zCgCH6j!h(n*+8Wvlr=rmYD_TS0mxe;ZUf13} z!gL85UD^u7p_U?=ipB!_jkBELudz^(Vm!7hK|IgE)&^;UTTu*Az@Txg|o85*qiIl)1r6Q-1lo UMO?a!LFXKr3>kgpStBF<0EDeh4gdfE delta 287 zcmW-bJ4ixd7>1v}(>bR7oghj=1+@kt8iSTbsUW%#ZP8e51#P)l(JBRhYlz*nyO%mP z1x+q(3DQtY5Kcj3E%g=e^6|p+J#RDm9xbLF6{u`DTXtv>n|9#4Om|nvBXURIgf)`q z#YFU)S};4hS0znBCoGSQsq0ucyRB4s;6C@$|Hov7DWTY>PQ!F|Or~ojd1RCZV>~m? zE5kHN@X0h^%>3(8XvqgT4n*$q#vw=YrH3buIiZC(HS%&<%#)$ODXpxs&Kc)2ImHSW zT;j0FGD}?HW0xteDGt&`l^7+;_<0~mg&P7g#pV`Ix~eF($OJV$cgUK>Z{lvSGUx88 EUu?)nUjP6A diff --git a/bin/net/grosinger/nomads/World.class b/bin/net/grosinger/nomads/World.class index 136695085ca47d0629f3f304f61bcb7fe4e8c7a7..dee904f8febdf58b38be4227969ad45aacd11f73 100644 GIT binary patch delta 35 qcmeC->*3qr$i|w&z`>9@*^RB9H=jX}p@2b&p^!n7p=k0YHY)&>iwH0P delta 35 qcmeC->*3qr$i|w+z`>9{*^RB9w~#@Qp@>0=p_oCFp=9zUHY)&?M+iIs diff --git a/sql_info.txt b/sql_info.txt new file mode 100644 index 0000000..6842d6c --- /dev/null +++ b/sql_info.txt @@ -0,0 +1,4 @@ +redundan_nomadswiki + +redundan_nomads +QQ[1_)gT5ST_!RZC^. \ No newline at end of file diff --git a/src/net/grosinger/nomads/Building.java b/src/net/grosinger/nomads/Building.java index 0973c57..9bb187a 100644 --- a/src/net/grosinger/nomads/Building.java +++ b/src/net/grosinger/nomads/Building.java @@ -3,9 +3,10 @@ package net.grosinger.nomads; /* * Anything that is on the theWorld that is not a drone of some sort is a building */ -public class Building extends GameObject { +public class Building implements GameObject { Structure structure; - + String name; + // Can't decide if I want to add Drone Houses as another enum item or as a // separate class that extends Building public enum Structure { @@ -16,6 +17,16 @@ public class Building extends GameObject { structure = thisBuilding; } + @Override + public String getName() { + return name; + } + + @Override + public void setName(String newName) { + name = newName; + } + /* * Information about how to use the switch command with enums * http://download.oracle.com/javase/tutorial/java/javaOO/enum.html diff --git a/src/net/grosinger/nomads/Drone.java b/src/net/grosinger/nomads/Drone.java index 737591c..2696e04 100644 --- a/src/net/grosinger/nomads/Drone.java +++ b/src/net/grosinger/nomads/Drone.java @@ -6,134 +6,21 @@ import net.grosinger.nomads.DroneListItem.EnumMove; * All drones will extend this class. Gives them access to basic set of tools * they need such as movement, discovery, and world interaction. */ -public class Drone extends GameObject { - private int age; +public interface Drone extends GameObject { /** - * Class constructor All custom drones should call their super constructor - * at the end of their own. + * This will give you a set of tools that will provide you will all the + * basic info your drone needs. */ - public Drone() { - if (Nomads.DEBUGSTATUS) - System.out.println("Drone initialized"); - } + public void setDroneTools(DroneTools yourTools); // Moving // When moving, North is positive Y axis and East is positive X axis - /** - * Starts the move, can be used to perform maintenance operations before the actual move - */ - public final EnumMove getMove() { - if (Nomads.DEBUGMOVES) - System.out.println("Drone " + name + " moving"); - return move(); - } - /** * The main move method for all Drones. Custom Drones should override this * with their own. */ - public EnumMove move() { - return EnumMove.NoMove; - } + public EnumMove move(); - - - /** - * Checks to see if the drone can move North - * - * @param amount - * of Distance to travel - * @return True if the move is possible, false if is invalid - */ - public final boolean canMoveNorth() { - return canMoveHelper(1, 0); - } - - /** - * Checks to see if the drone can move South - * - * @param amount - * of Distance to travel - * @return True if the move is possible, false if is invalid - */ - public final boolean canMoveSouth() { - return canMoveHelper(-1, 0); - } - - /** - * Checks to see if the drone can move East - * - * @param amount - * of Distance to travel - * @return True if the move is possible, false if is invalid - */ - public final boolean canMoveEast() { - return canMoveHelper(0, 1); - } - - /** - * Checks to see if the drone can move West - * - * @param amount - * of Distance to travel - * @return True if the move is possible, false if is invalid - */ - public final boolean canMoveWest() { - return canMoveHelper(0, -1); - } - - /** - * @param amountN - * The amount of desired travel North (negative will go South) - * @param amountE - * The amount of desired travel East (negative will go West) - * @return True if the move is possible, false if is invalid - */ - private final boolean canMoveHelper(int amountN, int amountE) { - int size = Nomads.awesomeWorld.getWorldSize(); - if (getY() + amountN >= size || getY() + amountN < 0 || getX() + amountE >= size || getX() + amountE < 0) { - if (Nomads.DEBUGMOVES) - System.out.println("Cannot move, out of range"); - return false; - } else if (Nomads.awesomeWorld.getObjectAt(getX() + amountE, getY() + amountN) != null) { - if (Nomads.DEBUGMOVES) - System.out.println("Cannot move, space occupied"); - return false; - } else { - if (Nomads.DEBUGMOVES) - System.out.println("Can move"); - return true; - } - } - - // Getters and Setters - - /** - * Returns how many turns this drone has been alive - * - * @return How many turns this drone has been alive - */ - public final int getAge() { - return age; - } - - // TODO - find a way to prevent the drone from accessing this - /** - * Do not use under normal circumstances - * - * @param newAge - * Age to set as the Drone's current age - */ - public final void setAge(int newAge) { - age = newAge; - } - - /** - * Increases the age of the drone by 1 turn - */ - public final void incrementAge() { - age++; - } } diff --git a/src/net/grosinger/nomads/DroneListItem.java b/src/net/grosinger/nomads/DroneListItem.java index 0aa290c..c1fb6ce 100644 --- a/src/net/grosinger/nomads/DroneListItem.java +++ b/src/net/grosinger/nomads/DroneListItem.java @@ -17,8 +17,17 @@ public class DroneListItem { private DroneListItem previous; private Drone current; + /** + * The DroneTools for this Drone + */ + private DroneTools yourTools; + public enum EnumMove { - NoMove, North, South, East, West, Upgrade, Attack + NoMove, North, South, East, West, Upgrade, Attack, Steal + } + + public enum Direction { + N, S, E, W } // Stats about this robot @@ -31,6 +40,13 @@ public class DroneListItem { private int speed; // Reflected in movements per turn private int turning; private int cargoSpace; + private int theft; + + // Info about this robot + + private int age; + private int x; + private int y; /* * Default constructor, includes all references @@ -40,6 +56,10 @@ public class DroneListItem { previous = thePrevious; current = theCurrent; visibleDistance = 15; + + // Give the Drone it's tools + yourTools = new DroneTools(current, this); + current.setDroneTools(yourTools); } // Getters and Setters @@ -136,6 +156,7 @@ public class DroneListItem { /** * Retrieve the total space in the cargo hold of this drone. Does include + * * space that is currently occupied. * * @return int @@ -144,6 +165,42 @@ public class DroneListItem { return cargoSpace; } + /** + * Retrieve the level of this drone in theiving + * + * @return int + */ + public int getTheft() { + return theft; + } + + /** + * Returns how many turns this drone has been alive + * + * @return How many turns this drone has been alive + */ + public int getAge() { + return age; + } + + /** + * Returns the x index of this drone + * + * @return int + */ + public int getX() { + return x; + } + + /** + * Returns the y index of this drone + * + * @return int + */ + public int getY() { + return y; + } + /** * Sets the next DroneListItem in the Linked List * @@ -170,7 +227,7 @@ public class DroneListItem { * @param newDistance * int New Distance */ - private void setVisibleDistance(int newDistance) { + public void setVisibleDistance(int newDistance) { visibleDistance = newDistance; } @@ -180,20 +237,27 @@ public class DroneListItem { * @param amount * int How much to increase the distance */ - private void increaseVisibleDistance(int amount) { + public void increaseVisibleDistance(int amount) { visibleDistance += amount; } + /** + * Increases the age of the drone by 1 turn + */ + public final void incrementAge() { + age++; + } + // Actions /** * Will ask the Drone what direction it would like to move * - * @return + * @return boolean if a move was made */ public boolean makeMove() { // Call the Drone's Move method - EnumMove move = current.getMove(); + EnumMove move = current.move(); switch (move) { case NoMove: { @@ -201,27 +265,31 @@ public class DroneListItem { return true; } case North: { - moveNorth(); + moveDrone(Direction.N); return true; } case South: { - moveSouth(); + moveDrone(Direction.S); return true; } case East: { - moveEast(); + moveDrone(Direction.E); return true; } case West: { - moveWest(); + moveDrone(Direction.W); return true; } case Upgrade: { - //TODO - Implement upgrade + // TODO - Implement upgrade return true; } case Attack: { - //TODO - Implement attack + // TODO - Implement attack + return true; + } + case Steal: { + // TODO - Implement steal return true; } default: { @@ -233,79 +301,27 @@ public class DroneListItem { // Movement - /** - * Tests if a move North is possible. Will make the requested move if - * possible. - * - * @param amount - * of distance to move North - * @return True if the move was made, false if is invalid - */ - public final boolean moveNorth() { - if (current.canMoveNorth()) { - moveHelper(1, 0); - return true; - } else - return false; - } - - /** - * Tests if a move South is possible. Will make the requested move if - * possible. - * - * @param amount - * of distance to move South - * @return True if the move was made, false if is invalid - */ - public final boolean moveSouth() { - if (current.canMoveSouth()) { - moveHelper(-1, 0); - return true; - } else - return false; - } - - /** - * Tests if a move East is possible. Will make the requested move if - * possible. - * - * @param amount - * of distance to move East - * @return True if the move was made, false if is invalid - */ - public final boolean moveEast() { - if (current.canMoveEast()) { - moveHelper(0, 1); - return true; - } else - return false; - } - - /** - * Tests if a move West is possible. Will make the requested move if - * possible. - * - * @param amount - * of distance to move West - * @return True if the move was made, false if is invalid - */ - public final boolean moveWest() { - if (current.canMoveWest()) { - moveHelper(0,-1); - return true; - } else - return false; - } - - /** - * Performs a move in the specified amounts - * - * @param amountN - * Amount of distance to move North (negative will go South) - * @param amountE - * Amount of distance to move East (negative will go West) - */ - public final void moveHelper(int amountN, int amountE) { - Nomads.awesomeWorld.moveObjectAt(current.getX(), current.getY(), amountN, amountE); + public void moveDrone(Direction direction) { + int amountN = 0; + int amountE = 0; + switch (direction) { + case N: { + amountN = 1; + break; + } + case S: { + amountN = -1; + break; + } + case E: { + amountE = 1; + break; + } + case W: { + amountE = -1; + break; + } + } + Nomads.awesomeWorld.moveObjectAt(getX(), getY(), amountN, amountE); } } diff --git a/src/net/grosinger/nomads/DroneTeam.java b/src/net/grosinger/nomads/DroneTeam.java index 19dcb47..a8c0b07 100644 --- a/src/net/grosinger/nomads/DroneTeam.java +++ b/src/net/grosinger/nomads/DroneTeam.java @@ -36,7 +36,7 @@ public class DroneTeam { public DroneTeam(DroneListItem firstList) { first = firstList; last = firstList; - teamName = firstList.getCurrent().name; + teamName = firstList.getCurrent().getName(); currentBalance = 0; } @@ -50,7 +50,7 @@ public class DroneTeam { DroneListItem firstList = new DroneListItem(null, null, (Drone) firstDrone); first = firstList; last = firstList; - teamName = firstDrone.name; + teamName = firstDrone.getName(); currentBalance = 0; } @@ -172,7 +172,24 @@ public class DroneTeam { public void getMoves() { DroneListItem current = first; while (current != null) { - current.getCurrent().getMove(); + // Increment the drone's age + current.incrementAge(); + // Have it perform it's moves + int turns = current.getSpeed(); + int currentTurn = 1; + int currentTry = 1; + while (currentTurn <= turns) { + boolean moved = current.makeMove(); + if (moved) + currentTurn++; + else + currentTry++; + + // Give the drone 3 tries to make a valid move before skipping + // them + if (currentTry > 3) + break; + } current = current.getNext(); } } diff --git a/src/net/grosinger/nomads/DroneTools.java b/src/net/grosinger/nomads/DroneTools.java new file mode 100644 index 0000000..611ba2e --- /dev/null +++ b/src/net/grosinger/nomads/DroneTools.java @@ -0,0 +1,61 @@ +package net.grosinger.nomads; + +/** + * Tools for the Drone to use. Only place methods in here that you want the + * drone to have access to. + */ +public class DroneTools { + + private Drone referredDrone; + private DroneListItem listItem; + + public DroneTools(Drone aDrone, DroneListItem droneParent) { + referredDrone = aDrone; + listItem = droneParent; + } + + /** + * Returns the X value of your Drone + * + * @return int - X value + */ + public int getX() { + return listItem.getX(); + } + + /** + * Returns the Y value of your Drone + * + * @return int - Y value + */ + public int getY() { + return listItem.getY(); + } + + /** + * Returns the age of this Drone + * + * @return int - Age + */ + public int getAge() { + return listItem.getAge(); + } + + // Movement + + public boolean canMoveNorth() { + return Nomads.awesomeWorld.getWorldGrid()[getY() + 1][getX()] == null; + } + + public boolean canMoveSouth() { + return Nomads.awesomeWorld.getWorldGrid()[getY() - 1][getX()] == null; + } + + public boolean canMoveEast() { + return Nomads.awesomeWorld.getWorldGrid()[getY()][getX() + 1] == null; + } + + public boolean canMoveWest() { + return Nomads.awesomeWorld.getWorldGrid()[getY()][getX() - 1] == null; + } +} diff --git a/src/net/grosinger/nomads/GameObject.java b/src/net/grosinger/nomads/GameObject.java index f485510..1bc451c 100644 --- a/src/net/grosinger/nomads/GameObject.java +++ b/src/net/grosinger/nomads/GameObject.java @@ -3,29 +3,8 @@ package net.grosinger.nomads; /* * Everything that is found on the world will be a type of game object */ -public class GameObject { - private int x; - private int y; - protected String name; - - // Getters and Setters - public int getX() { - return x; - } - - public int getY() { - return y; - } - - public void setX(int newX) { - x = newX; - } - - public void setY(int newY) { - y = newY; - } - - public void setName(String newName) { - name = newName; - } +public interface GameObject { + + public String getName(); + public void setName(String newName); } diff --git a/src/net/grosinger/nomads/World.java b/src/net/grosinger/nomads/World.java index df85996..a845d6d 100644 --- a/src/net/grosinger/nomads/World.java +++ b/src/net/grosinger/nomads/World.java @@ -85,8 +85,6 @@ public class World { return WORLDSIZE; } - // Why would we need a setter for theWorld? - /** * Used to set a new GameObject at a given location Not used for moving a * GameObject