Skip to content

Commit

Permalink
Fixed senses
Browse files Browse the repository at this point in the history
  • Loading branch information
DeflatedPickle committed Mar 18, 2018
1 parent 270a9ee commit 4bdb02c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
7 changes: 3 additions & 4 deletions src/goddrinksjava/GodDrinksJava.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ public static void main(String[] args) {

/* --------------- */

// The original code has this like as:
// if (me.getSenseIndex("vibration")) {
// But the method name suggests that it's supposed to return an Integer which would not work with an if statement as-is
if (me.getSenseIndex("vibration") == -1) {
// You think that this function would return the index of the given sense
// But since it's used like this, it might just check if the given sense exists in a list of senses
if (me.getSenseIndex("vibration")) {
me.addFeeling("complete");
}

Expand Down
32 changes: 25 additions & 7 deletions src/goddrinksjava/Thing.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
package goddrinksjava;

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

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

private List<String> senseList;

public Thing() {
memory = new Memory();
senseList = new ArrayList<>();
}

public void addAttribute(Attribute attribute) {
Expand Down Expand Up @@ -42,11 +48,6 @@ public Object toProof() {
return "";
}

// Not sure what to return
public Object toAttribute() {
return "";
}

public void lookFor(Thing thing, World world) {

}
Expand All @@ -63,59 +64,70 @@ public void escape(String... things) {
/* ----- Circle ----- */

// Not sure what to return
@Override
public Circumference getCircumference() {
return new Circumference();
}

@Override
public void resetCircumference() {

}

/* ----- PointSet ----- */

// Not sure what to return
@Override
public Dimension getDimensions() {
return new Dimension();
}

@Override
public void resetDimentions() {

}

/* ----- SineWave ----- */

@Override
public Tangent getTangent(Integer source) {
return new Tangent();
}

/* ----- Sequence ----- */

@Override
public void setLimit(Integer limit) {

}

/* ----- Fruit ----- */

// Not sure what to return
@Override
public Nutrients getNutrients() {
return new Nutrients();
}

@Override
public void resetNutrients() {

}

// Not sure what to return
@Override
public Nutrients getAntioxidants() {
return new Nutrients();
}

@Override
public void resetAntioxidants() {

}

/* ----- TabbyCat ----- */

@Override
public void purr() {

}
Expand Down Expand Up @@ -158,8 +170,14 @@ public void toggleRoleBDSM() {

}

public Integer getSenseIndex(String sense) {
return 0;
/**
* Checks if a sense is in the sense list.
*
* @param sense The sense to find.
* @return true if sense is in the list, else false.
*/
public Boolean getSenseIndex(String sense) {
return senseList.contains(sense);
}

public void removeFeeling(String feeling) {
Expand Down

0 comments on commit 4bdb02c

Please sign in to comment.