diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..c995aa5c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.debug.settings.onBuildFailureProceed": true +} \ No newline at end of file diff --git a/FullSpinner.java b/FullSpinner.java new file mode 100644 index 00000000..097344b9 --- /dev/null +++ b/FullSpinner.java @@ -0,0 +1,55 @@ +import java.util.ArrayList; +import java.util.Random; + +public class FullSpinner { + private ArrayList parts; + + public FullSpinner(){ + this.parts = new ArrayList<>(); + //addParts(); + } + + +public void addParts(){ + parts.add(new SpinnerPart("Red")); + parts.add(new SpinnerPart("Yellow")); + parts.add(new SpinnerPart("Blue")); + parts.add(new SpinnerPart("Orange")); + parts.add(new SpinnerPart("Red")); + parts.add(new SpinnerPart("Yellow")); + parts.add(new SpinnerPart("Blue")); + parts.add(new SpinnerPart("Orange")); + + //adding my candies + + parts.add(new SpinnerPart("Ice cream")); + parts.add(new SpinnerPart("Peanut")); + parts.add(new SpinnerPart("Lollipop")); + parts.add(new SpinnerPart("Licorice")); + + +} +//i'll need to add an override method to a to string + +// @Override +// public void toString(){ +// return "FullSpinner has a "; +// } +public String spin(){ + int Index = random.nextInt(parts.size()); //is it not recognizing random? + return parts.get(Index).toString(); + //how could i do this without a getOutput variable + + + // just declare a variable that would pick a random number from the number of stuff in the arraylist + //and then just get it to spit out that index + + +} +public static void main(String[] args) { + FullSpinner spinner = new FullSpinner(); + spinner.addParts(); + System.out.println(spinner); +} + +} diff --git a/Player.java b/Player.java new file mode 100644 index 00000000..9304cbea --- /dev/null +++ b/Player.java @@ -0,0 +1,47 @@ +public class Player { + private String name; + private String color; + private String shape; + private int position; + private String currPosition; + + + public Player(String name,String color, String shape,int position){ + this.name = name ; + this.color = color; + this.shape = shape; + this.currPosition = "red";//if we have all the points on the map that the player can be at set up as an arraylist then im setting this to 0 as statring position + this.position = position; + + } + + public String getName(){ + return name; + } + + public int getPosition(){ + return position; + } + + public void setPosition(int position){ + this.position=position;//setter cause this is the only one we need to manipulate + } + + + + public String getCurrPosition() { + return currPosition; + } + + public void setCurrPosition(String currPosition) { + this.currPosition = currPosition; + } + + public String toString(){ + return this.name + " color: " + this.color + " " + this.shape + " player named " + this.name; // Corrected toString + + } + + +} + diff --git a/SpinnerPart.java b/SpinnerPart.java new file mode 100644 index 00000000..279ce92e --- /dev/null +++ b/SpinnerPart.java @@ -0,0 +1,69 @@ +import java.util.random; +import java.util.ArrayList; +import java.util.Random; + + +public class SpinnerPart { + //text based version of the spinner + // private output; + //this could be a string or an int - and i need to remember the abstraction way to fix that + // private ArrayList Parts; + private String Item; + private String Color; + + + //initialize the constructor + // public Spinner(ArrayList Parts){ + // this.Parts = new ArrayList<>(); + // } +//overloading + public SpinnerPart(String Color) { + this.Color = Color; +} + public SpinnerPart(String Color, String Item) { + this.Color = Color; + this.Item = Item; + } + + public String getColor(){ + return Color; + } + + //add sections of candyland spinner onto my parts arraylist maybe in a method + + // public ArrayList makeList(String Part){ + // Parts.add(Part); + + // return Parts; + // } + + public String getItem(){ + return Item; + } + + + + + + +} + +//player takes a turn spinning the spinner : +//if they land on 1 of 2 oranges go to nearest orange +//same logic for purples blues yellow, greens and reds + +//if it lands on the pepperminet : +//if it lands on the peanut thingy = // Nana’s NutHouse Class +//if it lands on the lollypop = Lollipop Palace +//if it lands on the icecream + +//Map Class +// Peppermint Forest Class +// Licorice Lagoon +// Castle Class - by inheritance +// Lollipop Palace +// Frosted Palace Class +// Queen Kandy’s Castle Class + + +