Skip to content

Commit

Permalink
Added a few methods
Browse files Browse the repository at this point in the history
  • Loading branch information
DeflatedPickle committed Mar 26, 2018
1 parent 4bdb02c commit 922af27
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/goddrinksjava/Lovable.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

public class Lovable extends Thing {
public Lovable(String name, Integer i, Boolean b, Integer i2, Boolean b2) {

myName = name;
}
}
12 changes: 9 additions & 3 deletions src/goddrinksjava/Thing.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
import java.util.List;

public class Thing implements Circle, PointSet, SineWave, Sequence, Fruit, TabbyCat {
private Memory memory;
public String myName;

private Memory memory;
private List<String> senseList;

public Thing() {
Expand Down Expand Up @@ -49,7 +50,12 @@ public Object toProof() {
}

public void lookFor(Thing thing, World world) {

if (world.thingList.contains(thing)) {
System.out.println(String.format("Found %s", thing.myName));
}
else {
System.out.println(String.format("Could not find %s", thing.myName));
}
}

// Not sure what to return
Expand Down Expand Up @@ -129,7 +135,7 @@ public void resetAntioxidants() {

@Override
public void purr() {

System.out.println("Purr");
}

/* ----- Lovable ----- */
Expand Down
16 changes: 12 additions & 4 deletions src/goddrinksjava/World.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package goddrinksjava;

import java.util.ArrayList;
import java.util.List;

public class World {
private Boolean settingGod = true;
public final List<Thing> thingList;

private Boolean settingGod = true;
private Lovable God;

public World(Integer i) {

thingList = new ArrayList<>();
}

public void addThing(Thing thing) {
Expand All @@ -15,10 +19,13 @@ public void addThing(Thing thing) {

settingGod = false;
}

thingList.add(thing);
System.out.println(String.format("Added %s", thing.myName));
}

public void startSimulation() {

System.out.println("Starting simulation");
}

public void timeTravelForTwo(String period, Integer year, Thing first, Thing second) {
Expand Down Expand Up @@ -50,7 +57,8 @@ public void unlock(Thing thing) {
}

public void removeThing(Thing thing) {

thingList.remove(thing);
System.out.println(String.format("Removed %s", thing.myName));
}

public void announce(String... s) {
Expand Down

0 comments on commit 922af27

Please sign in to comment.