Back to project page project2.
The source code is released under:
MIT License
If you think the Android project project2 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package team2.scdm; //from ww w .j av a2 s .co m import java.util.ArrayList; import java.util.Random; import com.google.android.gms.maps.model.LatLng; public class Folk extends NPC { private int gamble; // weapon or armor type possible to obtain from folk. /** * Create a folk of random type. */ public Folk(LatLng player) { super(player); Random rand = new Random(); type = friendlyTypes[rand.nextInt(friendlyTypes.length)]; } /** * Create a folk of a specific type. Call with "new Folk(Folk.CLOWN)" * @param type * The type the folk is */ public Folk(LatLng player, int type) { super(player); int size = Item.items.length; Random rand = new Random(); gamble = rand.nextInt(size); // might need to fix but Anne says it's good. gamble = Item.items[gamble]; this.type = type; } // TODO: Implement this public int tradeItem() { return gamble; } }